File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes How Do I Keep HttpSessions Alive in Tomcat? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "How Do I Keep HttpSessions Alive in Tomcat?" Watch "How Do I Keep HttpSessions Alive in Tomcat?" New topic
Author

How Do I Keep HttpSessions Alive in Tomcat?

Jason Fot
Greenhorn

Joined: Aug 26, 2010
Posts: 1
I'm having a bit of trouble with Session timeouts in my Tomcat served web application. From reading over Tomcat's documentation, sessions expire after a time which can be configured in the web.xml file.



Question) Does this mean 30 minutes from when the session was created for the user? Or 30 minutes from when the session was last accessed?

If it is, as I originally thought, 30 minutes from when the session was last accessed, I don't seem to be seeing this behavior. My sessions seem to be lost as I'm using the site. Are there any other ways to configure session behavior besides this one setting? Is there something I'm missing?

Apache Tomcat/6.0.20

This message was edited 1 time. Last update was at by Jason Fot

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11691
1. the timeout is reset every time there is a request, there are also methods for changing the timeout for an individual session.

2. note that a session is tied to a given web application - it will not be kept alive if you move to another application in the same server.

Bill

Java Resources at www.wbrogden.com
 
 
subject: How Do I Keep HttpSessions Alive in Tomcat?
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com