File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Session time out. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Session time out." Watch "Session time out." New topic

Session time out.

Arun Vethadas .T
Ranch Hand

Joined: Dec 13, 2001
Posts: 36
what is the default time for session invalidation. how many minutes. how i find it. how i chang it in JSP page & servlet file.
pls.Help me.
Pranit Saha
Ranch Hand

Joined: Sep 09, 2001
Posts: 130
In JSP you can set the time as:
After the specified seconds session will be expired automatically if no request has been made..
Thanks and regards,
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
I found the following in Tomcat's base web.xml file in the Tomcat-home/conf/ directory

30 minutes seems to be a commonly used number.
Anthony Villanueva
Ranch Hand

Joined: Mar 22, 2002
Posts: 1055
In the HTTP protocol, there is no explicit termination signal when a client is no
longer active. This means that the only mechanism that can be used to indicate when a client is no longer active is a timeout period.
The default timeout period for sessions is defined by the servlet container and can be obtained via the getMaxInactiveInterval method of the HttpSession interface. This timeout can be changed by the Developer using the setMaxInactiveInterval method of the HttpSession interface. The timeout periods used by these methods are defined in seconds. By definition, if the timeout period for a session is set to -1, the session will never expire.

But the default is server-dependent.
Arun Vethadas .T
Ranch Hand

Joined: Dec 13, 2001
Posts: 36
Hi All
Thanks for nice help.
I agree. Here's the link:
subject: Session time out.
It's not a secret anymore!