This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Session Timeout Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Session Timeout Problem" Watch "Session Timeout Problem" New topic
Author

Session Timeout Problem

Ansar Shah
Greenhorn

Joined: May 02, 2007
Posts: 29
Hello

I have a problem in session management. I want to automatically logout the user when session expires. Used HttpSessionBindingListener for this purpose and set the session expiry value in the web.xml of my application.

Now the problem is that the session expiry behaviour is not consistent at all. I have set the time out of 3 minutes. But it didnt expired even waiting for more than 15 mins. BUT sometimes it suddenly works and session expires.
Please help me in this strange behaviour.

Thanks
Walter Bernstein
Ranch Hand

Joined: Dec 19, 2007
Posts: 57
The session timeout is not guarenteed to happen at the specified time. It only guarantees the session timout doesn't happen before the specfied timeout. Typically this is all you need. If that behviour is not sufficient store the last access time in the session and check/update this timestamp on every request (ServletFilter).
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Session Timeout Problem
 
Similar Threads
Browser Closing without signout from site
how to make page to expire
Application logout problem
Setting up the time of the headers in JSP
Increase Session expiry limit