Tomcat - Session expiration (timeout)

by
Jeremy Canfield |
Updated: March 09 2020
| Tomcat articles
You may want to first read about the difference between a session and a cookie.
The session timeout is set in the JVMs web.xml file. Typically, the default setting is 30 (minutes). If you change the session timeout value, you will have to restart the JVM for the change to take effect.
<session-config>
<session-timeout>30</session-timeout>
</session-config>
For demonstration purposes, the screen shot below shows a Java app displaying the session ID number.
Then, after 30 minutes, the app has a new session ID number, since the prior session timed out after 30 minutes.
Did you find this article helpful?
If so, consider buying me a coffee over at