0
点赞
收藏
分享

微信扫一扫

一步一步教你用shiro——3配置并自定义sessionManager

有态度的萌狮子 2021-09-28 阅读 72
码哥
  • 一步一步教你用shiro——1引入shiro框架
  • 一步一步教你用shiro——2配置并自定义realm
  • 一步一步教你用shiro——3配置并自定义sessionManager
  • 一步一步教你用shiro——4配置并自定义sessionDao
  • 一步一步教你用shiro——5配置rememberMe
  • 一步一步教你用shiro——6总结和心得
        <property name="sessionManager">
            <bean class="com.qunar.lfz.shiro.MySessionManager">
                <!--默认自动检查session过期,删除过期session-->
                <property name="globalSessionTimeout" value="1800000"/>
                <property name="sessionValidationInterval" value="1800000"/>
                <!--默认MemorySessionDao-->
                <property name="sessionDAO">
                    <!--默认使用javaUuidGenerator-->
                    <bean class="com.qunar.lfz.shiro.MyRedisSessionDao"/>
                </property>
                <property name="sessionIdCookie">
                    <bean class="org.apache.shiro.web.servlet.SimpleCookie">
                        <constructor-arg value="shiroCookie"/>
                    </bean>
                </property>
                <!--避免url中出现jsessionid-->
                <property name="sessionIdUrlRewritingEnabled" value="false"/>
                <!--默认使用ExecutorServiceSessionValidationScheduler,AbstractValidatingSessionManager:209-->
            </bean>
        </property>
举报

相关推荐

0 条评论