简体   繁体   English

Spring为什么会话在会话超时之前过期?

[英]Spring Why session get expired before session-timeout?

I am using Spring security authentication and after successful logis is session set. 我正在使用Spring安全认证,并且在成功登录后设置了会话。 I have configured session-timeout on 10 minutes, but session is removed after few minutes. 我已经配置了10分钟的session-timeout ,但是几分钟后会话被删除。 I don't know why. 我不知道为什么

Here is debug output: 这是调试输出:

2013-09-13 12:34:29 DEBUG HttpSessionEventPublisher:83 - Publishing event: org.springframework.security.web.session.HttpSessionDestroyedEvent[source=org.apache.catalina.session.StandardSessionFacade@5d67c24a]
2013-09-13 12:34:29 DEBUG SessionRegistryImpl:156 - Removing session CA174F1B4B889FFDBF47E22C7C4D5A0B from principal's set of registered sessions
2013-09-13 12:34:29 DEBUG SessionRegistryImpl:164 - Removing principal org.springframework.security.core.userdetails.User@d50fea1e: Username: tester; Password: [PROTECTED]; Enabled: true; AccountNonExpired: true; credentialsNonExpired: true; AccountNonLocked: true; Granted Authorities: ROLE_MANAGER,ROLE_USER from registry

web.xml web.xml

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

Session timeout can be overridden by various means. 会话超时可以通过各种方法来覆盖。 See http://docs.oracle.com/javaee/1.3/api/javax/servlet/http/HttpSession.html#setMaxInactiveInterval(int) . 请参阅http://docs.oracle.com/javaee/1.3/api/javax/servlet/http/HttpSession.html#setMaxInactiveInterval(int) Make sure there isn't anything else that is overriding it (Web/App server, framework, ...). 确保没有其他东西可以覆盖它(Web / App服务器,框架等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM