Acegi concurrent session

本文介绍如何使用Acegi Security配置并发会话控制器以限制用户的并发登录会话数,并设置会话过期后的重定向URL。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

.
<bean id="concurrentSessionController" class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl"> <bean id="concurrentSessionController" class="org.acegisecurity.concurrent.ConcurrentSessionControllerImpl">
<!-- 設成-1 不會限制, 不可以是0, 大於0則是依據數字提供session --> <!--设成-1不会限制,不可以是0,大于0则是依据数字提供session -->
<property name="maximumSessions"><value>1</value></property> <property name="maximumSessions"><value>1</value></property>
<property name="sessionRegistry"><ref local="sessionRegistry"/></property> <property name="sessionRegistry"><ref local="sessionRegistry"/></property>
</bean>
<bean id="concurrentSessionFilter" class="org.acegisecurity.concurrent.ConcurrentSessionFilter"> <bean id="concurrentSessionFilter" class="org.acegisecurity.concurrent.ConcurrentSessionFilter">
<property name="expiredUrl" value="/login.jsp"/> <property name="expiredUrl" value="/login.jsp"/>
<property name="sessionRegistry" ref="sessionRegistry"/> <property name="sessionRegistry" ref="sessionRegistry"/>
</bean>
<bean id="sessionRegistry" class="org.acegisecurity.concurrent.SessionRegistryImpl"/> <bean id="sessionRegistry" class="org.acegisecurity.concurrent.SessionRegistryImpl"/>

2.
在filterChainProxy 裡面加上concurrentSessionFilter 在filterChainProxy里面加上concurrentSessionFilter
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值