Default session expiration timeout?

可紊 提交于 2020-01-13 09:06:12

问题


By default the JSESSIONID cookie is expired when you close the browser, but how long is the associated HttpSession really valid on the server side?


回答1:


It defaults to 30 minutes on most containers which you can configure by <session-config> in your webapp's web.xml.

<session-config>
    <session-timeout>10</session-timeout>
</session-config>

The above example will change the server side session timeout to 10 minutes. So in other words, when the client do not interact with the server for more than 10 minutes (even though the browser is kept open that long), then the session will expire on the server side. Any next request will create a new session.

See also:

  • How do servlets work? Instantiation, sessions, shared variables and multithreading


来源:https://stackoverflow.com/questions/7449468/default-session-expiration-timeout

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