1、在容器中设置:如在tomcat\conf\web.xml中设置

 

    1. <session-config>    
    2.         <session-timeout>30</session-timeout>    
    3. </session-config

2、在工程的web.xml中设置

  1. <session-config>  
  2.       <session-timeout>15</session-timeout>  
  3. </session-config>

3、通过Java代码设置

  session.setMaxInactiveInterval(30*60);//以秒为单位

 

优先级:  3 > 2 > 1

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2021-11-17
猜你喜欢
  • 2021-11-23
  • 2021-06-04
相关资源
相似解决方案