Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Default session timeout for Apache Tomcat applications

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.

like image 283
Infotechie Avatar asked Jan 21 '13 05:01

Infotechie


People also ask

How does session timeout work in Tomcat?

The number in session-timeout tag is in minutes. To make it unlimited or no time out in Tomcat, simply set the number to -1 and restart your Tomcat.

What is the default timeout of session in your application?

Specifies the number of minutes that a session can remain idle before the server terminates it automatically. The default is 10 minutes.

What is the default session timeout in Java?

Session timeout determines how long the server maintains a session if a user does not explicitly invalidate the session. The default value is 30 minutes.


1 Answers

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

like image 86
Evgeniy Dorofeev Avatar answered Oct 03 '22 02:10

Evgeniy Dorofeev