这是我的配置文件,我配置了并发人数控制和动态权限过滤,然后session超时时间这里也是配置了的,然后并没有什么鸟用,在登录以后获取超时时间也是正常的,但还是1分钟就过期了。
<?xml version="1.0" encoding="UTF-8"?>
xmlns:util="http://www.springframework.org/schema/util"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="shiroFilter"/>
<property name="targetMethod" value="setFilterChainResolver"/>
<property name="arguments" ref="filterChainResolver"/>
</bean>
<bean id="filterChainResolver" class="com.sfkj.platform.shiro.CustomPathMatchingFilterChainResolver">
<property name="customDefaultFilterChainManager" ref="filterChainManager"/>
</bean>
<bean id="filterChainManager" class="com.sfkj.platform.shiro.CustomDefaultFilterChainManager">
<property name="loginUrl" value="/index/redirect.html"/>
<property name="successUrl" value="/index/redirect.html"/>
<property name="unauthorizedUrl" value="/index/unauthorizedUrl.html"/>
<property name="customFilters">
<util:map>
<entry key="kickout" value-ref="kickoutSessionControlFilter"/>
<entry key="sysUser" value-ref="sysUserFilter"/>
</util:map>
</property>
<property name="defaultFilterChainDefinitions">
<value>
<!-- /login = authc
/logout = logout
/unauthorized.jsp = authc
/** = user,sysUser -->
/admin/**=kickout
/** =anon
</value>
</property>
</bean>
<bean id="sysUserFilter" class="com.sfkj.platform.shiro.SysUserFilter"/>
<bean id="kickoutSessionControlFilter" class="com.sfkj.platform.shiro.KickoutSessionControlFilter">
<property name="cacheManager" ref="cacheManager"/>
<property name="sessionManager" ref="sessionManager"/>
<property name="kickoutAfter" value="false"/>
<property name="maxSession" value="1"/>
<property name="kickoutUrl" value="/index/kickoutUrl.html"/>
</bean>
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="securityManager" ref="securityManager" />
</bean>
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="realm" ref="userRealm" />
<property name="cacheManager" ref="cacheManager" />
<property name="sessionManager" ref="sessionManager"/>
</bean>
<bean id="userRealm" class="com.sfkj.platform.shiro.UserRealm"/>
<!-- 缓存管理器 使用Ehcache实现 -->
<bean id="cacheManager" class="org.apache.shiro.cache.ehcache.EhCacheManager">
<property name="cacheManager" ref="ehCacheManager"/>
<property name="cacheManagerConfigFile" value="classpath:ehcache-shiro.xml"/>
</bean>
<bean id="ehCacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>
<!-- 会话管理器 -->
<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<property name="globalSessionTimeout" value="604800000"/>
<property name="deleteInvalidSessions" value="true"/>
<property name="sessionValidationSchedulerEnabled" value="true"/>
<!-- <property name="sessionValidationScheduler" ref="sessionValidationScheduler"/> -->
<property name="sessionDAO" ref="sessionDAO"/>
<property name="sessionIdCookieEnabled" value="true"/>
<property name="sessionIdCookie" ref="sessionIdCookie"/>
</bean>
<!-- 会话验证调度器 -->
<!--<bean id="sessionValidationScheduler" class="org.apache.shiro.session.mgt.quartz.QuartzSessionValidationScheduler">
<property name="sessionValidationInterval" value="1800000"/>
<property name="sessionManager" ref="sessionManager"/>
</bean> -->
<!-- 会话DAO -->
<bean id="sessionDAO" class="org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO">
<property name="activeSessionsCacheName" value="shiro-activeSessionCache"/>
<property name="sessionIdGenerator" ref="sessionIdGenerator"/>
</bean>
<!-- 会话ID生成器 -->
<bean id="sessionIdGenerator" class="org.apache.shiro.session.mgt.eis.JavaUuidSessionIdGenerator"/>
<!-- 会话Cookie模板 -->
<bean id="sessionIdCookie" class="org.apache.shiro.web.servlet.SimpleCookie">
<constructor-arg value="sid"/>
<property name="httpOnly" value="true"/>
<property name="maxAge" value="-1"/>
</bean>
<!-- Shiro生命周期处理器-->
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="604800"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="604800"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="604800"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">
maxEntriesLocalHeap="2000"
eternal="false"
timeToIdleSeconds="604800"
timeToLiveSeconds="0"
overflowToDisk="false"
statistics="true">