aspose file tools
The moose likes Servlets and the fly likes How to Manage HttpSession with inactive time period? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "How to Manage HttpSession with inactive time period?" Watch "How to Manage HttpSession with inactive time period?" New topic
Author

How to Manage HttpSession with inactive time period?

Amanda Mosby
Greenhorn

Joined: Apr 05, 2012
Posts: 2
In the following post , i found about how to mantain session objects
http://www.coderanch.com/t/365859/Servlets/java/session-object-session-ID

specifically






how to use this in my own servlet, how to setHttpSession and getHttpSession
each time i have a new request on my servlet
and how will remove it if the session from the map when its no longer in use again
so is there auto timer for each session, so that it get deleted automatically from the hashmap,
when the given time period is reached and its no longer used by my servlet/server application
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56163
    
  13

Your terminology is off. You are not adding or removing "sessions". There is only one session available to your servlet, and you are adding and removing "scoped variables", also called "attributes", to it.

I'm not really understanding what your question is. You can add or remove scoped variables to the session any time you like. All scoped variables in the session will automatically be removed if the session times out.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Manage HttpSession with inactive time period?
 
Similar Threads
destroy sessionContext from EJB?
How to invalidate user's session forcefully
How do you retrieve all the sessions?
Get session object from session ID
Immediately Invalidate another user's session after admin locks a user or changes a user's authoriti