Changing the default session timeout of a spring web application

Deadly 提交于 2019-12-20 08:48:59

问题


I have to test a web application that is written by spring and jsp. The default session-timeout for the application is 30 min.

I want to reduce the session-timeout. For doing this, I have changed in the web.xml file in tomcatInstallationLocation/conf/. But it doesn't work. The default configuration in tomcatInstallationLocation/conf/web.xml was -

<session-config>
    <session-timeout>30</session-timeout>
</session-config>

Where I've just changed the time and make it -

<session-config>
    <session-timeout>5</session-timeout>
</session-config>

But is still doesn't work. As I know far, in this situation I have to make a change in my spring application's web.xml. But I'm not sure. Can any one help me?

Thanks in advance.


回答1:


Session timeout hierarchy:

  • $tomcat_home/conf/web.xml
  • $your_webapp/WEB-INF/web.xml
  • manual invocation of HttpSession.setMaxInactiveInterval(int)

Each subsequent entry overrides others above.



来源:https://stackoverflow.com/questions/12932589/changing-the-default-session-timeout-of-a-spring-web-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!