The server tomcat is closed and the session is still there

I always thought that the server was closed and the session was gone. As a result, a pit was encountered, the server was restarted, and the user was using the old session.
http://blog.csdn.net/w420372197/article/details/7310293

If Tomcat is configured as session persistence, when Tomcat is closed, it will not Trigger the Session destroy event. Instead, the content of each Session is written to a file. When Tomcat starts again, it will read this parameter and verify whether the Session is TimeOut (but this verification seems to be a bit delayed, about a few seconds. If a timeout is detected, Tomcat will automatically trigger the Session Destroy event).
After 12 hours, the session of these users will expire.



How to configure Tomcat Session persistence?

By default, Tomcat6 provides this feature. Please see $TOMCAT_HOME$/conf/context.xml. At about line 24, you will see the comment:

Xml code Favorite code
<!-- Uncomment this to disable session persistence across Tomcat restarts --> 
<!--
<Manager pathname="" />
--> 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326614561&siteId=291194637