Servlet sets session-timeout to 0 so that session does not expire and does not work

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>

does not mean that < = 0 does not expire, only-1 means that it does not expire. -2 means to use the TimeoutSecs value of < session-descriptor > in weblogic.xml.

<session-timeout>-1</session-timeout>
Menu