默认会话到期超时? [英] Default session expiration timeout?

查看:251
本文介绍了默认会话到期超时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,当您关闭浏览器时, JSESSIONID cookie已过期,但关联的 HttpSession

对于大多数容器,默认为30分钟,您可以通过配置

< session-config>

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

上述示例将服务器端会话超时更改为10分钟。因此,换句话说,当客户端不与服务器交互超过10分钟(即使浏览器保持打开那么长时间),那么会话将在服务器端过期。



另请参阅:




  • servlet如何工作?实例化,会话变量和多线程


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?

解决方案

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:

这篇关于默认会话到期超时?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆