aspose file tools*
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
Author

Session time out.

Arun Vethadas .T
Ranch Hand

Joined: Dec 13, 2001
Posts: 36
hai
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.
Thanks,
Arun.
Pranit Saha
Ranch Hand

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

Joined: Mar 22, 2000
Posts: 12835
    
    5
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.
Bill
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.
-anthony
Arun Vethadas .T
Ranch Hand

Joined: Dec 13, 2001
Posts: 36
Hi All
Thanks for nice help.
Arun.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Session time out.