To set the session timeout for the Tomcat web application, call HttpSession.setMaxInactiveInterval(int interval) -- interval is the idle time in seconds before timeout. e.g. HttpSession.setMaxInactiveInterval(30) times out the session if it is idle more than 30 seconds.
If the above method is not call in the application, the session-timeout configuration in the application's web.xml defines the timeout in minutes. e.g. WEB-INF/web.xml:
<session-config>
<session-timeout>1</session-timeout>
</session-config>
The above configuration times out the session after 1 minute.
If the session-timeout is not set in the application's web.xml, it is defined in TOMCAT_HOME/conf/web.xml:
<session-config>
<session-timeout>30</session-timeout>
</session-config>
Tuesday, September 19, 2017
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment