to achieve session persistence and ensure that it never expires, my approach is to set the session expiration time in web.xml
<session-config>
<session-timeout>0</session-timeout>
</session-config>
at the same time, I didn"t set session.setMaxInactiveInterval, so the priority here is the highest. It works when you try to set > 0, but when you set < = 0, the expiration time of the output is-60, and session will expire soon. The persistence work is done in context.xml, and the code is as follows. I now feel that the existence of persistence has a certain impact on the above never expired, but I really do not know what the specific relationship is, and how to further configure to ensure that it will never expire, please give me your advice, thank you!
<Manager className="PersistentManager"
saveOnRestart="true"
maxActiveSession="-1"
minIdleSwap="0"
maxIdleSwap="30"
maxIdleBackup="0">
<Store className="JDBCStore"
driverName="Driver"
connectionURL="mysql://localhost?user;password"
sessionTable="cache_session"
sessionIdCol="session_id"
sessionDataCol="data"
sessionValidCol="session_valid"
sessionMaxInactiveCol="max_inactive"
sessionLastAccessedCol="last_access"
sessionAppCol="application_name"
checkInterval="60"
debug="99" />
</Manager>