使用Spring Security 3.0设置会话超时期限 [英] Setting session timeout period with Spring Security 3.0

查看:2051
本文介绍了使用Spring Security 3.0设置会话超时期限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Spring Security 3.0对LDAP服务器进行身份验证,我无法确定是否设置了自己的会话超时时间。我相信默认值是30分钟,但我需要将其设置为长于

I am using Spring Security 3.0 to authenticate with an LDAP server and I cannot figure out to set my own session timeout period. I believe that the default is 30 minutes but I need to set it to longer than that

推荐答案

您可以设置会话超时(例如60分钟)web.xml中的所有会话:

You can either set the session timeout (say 60 minutes) for all sessions in web.xml:

<session-config>
  <session-timeout>60</session-timeout>
</session-config>

或每个会话使用

session.setMaxInactiveInterval(60*60);

您可能希望在authorizationSuccessHandler中执行后者。

the latter you might want to do in a authorizationSuccessHandler.

<form-login authentication-success-handler-ref="authenticationSuccessHandler"/>

这篇关于使用Spring Security 3.0设置会话超时期限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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