Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring security-exceptionifmaximumextended=false不终止最旧的会话_Java_Spring_Session_Spring Mvc_Spring Security - Fatal编程技术网

Java Spring security-exceptionifmaximumextended=false不终止最旧的会话

Java Spring security-exceptionifmaximumextended=false不终止最旧的会话,java,spring,session,spring-mvc,spring-security,Java,Spring,Session,Spring Mvc,Spring Security,我在spring security中有以下内容: <bean class="org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy"> <constructor-arg ref="clusteredSessionRegistryImpl" /> <pr

我在spring security中有以下内容:

 <bean  class="org.springframework.security.web.authentication.session.ConcurrentSessionControlAuthenticationStrategy">
                <constructor-arg ref="clusteredSessionRegistryImpl" />
                <property name="maximumSessions" value="1" />
                <property name="exceptionIfMaximumExceeded" value="false" />
            </bean>

现在,根据文档-此配置应允许用户反复登录,而每次登录将使最旧的会话(如果存在)无效。这不起作用,我可以使用同一用户名多次登录。每次都会创建一个新会话,但不会发生无效

p、 s如果我将ExceptionIfMaximumExcepended更改为“True”,它将按预期工作。(我第二次登录时出错)


有什么想法吗?

如果您使用的是自定义的
UserDetails
实现,那么您必须在该类中正确定义
equals()
hashcode()
方法

点击这个链接