Java Spring security-exceptionifmaximumextended=false不终止最旧的会话
我在spring security中有以下内容: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
<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()
方法
点击这个链接