How to do a simple session timeout?
Created Jan 8, 2003
Christopher Schultz In
WEB-INF/web.xml, use the following incantation:
<webapp>
.
.
<session-config>
<session-timeout>30</session-timeout> <!-- 30 minutes -->
</session-config>
.
.
</webapp>
It's one of the last sub-elements of <webapp>. Check the DTD if you're unsure.
See also:
- How close is the actual session timeout period to the specified timeout period?
- How can you set the session timeout in tomcat higher?
- How can an HttpSessionListener comunicate directly to an user web browser that his session has been destroyed by server web.xml "timeout" parameter?
- Is there a way to detect when the session has expired, so that we can send a redirect to a login page?
- How can I prevent the expiration of a Session?
- How do I set session timeouts of greater than 30 minutes?