| Java FAQ | ||
| JSP FAQ | ||
| Servlet FAQ | ||
XyzWs Servlet FAQ:
Can I control Session timeout?
Printer-friendly version |
Mail this to a friend
|
Advertisement
|
Can I control Session timeout?
Yes, you can change the session timeout in your application.
By default, on most servers the session is set to expire after 30 minutes of inactivity.
The amount of time can be configured in the deployment descriptor of the Web application.
For example, to change the session timeout to one hour, add the following inside the <session-config> <session-timeout>60</session-timeout> </session-config>
The
The length of time will vary depending on what your visitors are doing on your site. If they're logging in to check their account balance, a shorter session timeout period can be used because it doesn't take long for a person to read a couple of numbers. If, on the other hand, the user is logging in to read large amounts of data, you need to be sure that you provide enough time for the user to do what he or she wants without being logged out. If the user is constantly navigating through your site, the session will last indefinitely. |