Default session timeout for Apache Tomcat applications

JavaTomcatSession Timeout

Java Problem Overview


What is the default session timeout for web applications deployed on Tomcat5.5? Is it browser specific? In my web application, default timeout is mentioned neither in web.xml nor in code.

Java Solutions


Solution 1 - Java

Define inside web.xml

Open $CATALINA_BASE/conf/web.xml and find this:

<!-- ==================== Default Session Configuration ================= -->
<!-- You can set the default session timeout (in minutes) for all newly   -->
<!-- created sessions by modifying the value below.                       -->

<session-config>
    <session-timeout>30</session-timeout>
</session-config>

All webapps implicitly inherit from this default web descriptor. You can override these default settings via your webapp's own web.xml file.

This is actually from my Tomcat 7 (Windows) but I think Tomcat 5.5's configuration is not very different

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionInfotechieView Question on Stackoverflow
Solution 1 - JavaEvgeniy DorofeevView Answer on Stackoverflow