File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
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: 3
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: 61761
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Manage HttpSession with inactive time period?