wood burning stoves
The moose likes Tomcat and the fly likes Tomcat HttpSession inactivity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat HttpSession inactivity" Watch "Tomcat HttpSession inactivity" New topic

Tomcat HttpSession inactivity

Panda Mima

Joined: Aug 04, 2006
Posts: 14
Hi there,

I know that to change default (30 minutes?) HttpSession expiration time out we put

into web.xml. So with this setting, the user's session will be automatically deactivated after x minutes of inactivity.

My question is: how Tomcat determines this "inactivity"? Does that mean time which user didn't access HttpSession object? or what exactly? Or this user didn't access any server's (okay, application's) page at all, even if page does not use HttpSession?

Please help!
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Any hit to the server from that client will be consider activity and will reset the timeout.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Panda Mima

Joined: Aug 04, 2006
Posts: 14
How this "client" is detected? By IP? or how?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63873

By the session id, which is passed in a cookie or as part of the URL (with URL rewriting).

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link: http://aspose.com/file-tools
subject: Tomcat HttpSession inactivity
jQuery in Action, 3rd edition