Three ways to set the survival time of Session

The default time of the session is 30 minutes, set it to 0 or the affiliate does not limit the effective time.

1. Set in html

<session-config>     
         <session-timeout> 30 </session-timeout>     
</session-config>  
2.web.xml settings
<session-config>  
     <session-timeout> 15 </session-timeout>  
</session-config>  
3. Set in java code
session.setMaxInactiveInterval( 30 * 60 ); // in seconds   
Priority 3-->2-->1

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324807403&siteId=291194637