com.ruoyi.framework.shiro.web.session.SpringSessionValidationScheduler Java Examples

The following examples show how to use com.ruoyi.framework.shiro.web.session.SpringSessionValidationScheduler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ShiroConfig.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 会话管理器
 */
@Bean
public OnlineWebSessionManager sessionManager()
{
    OnlineWebSessionManager manager = new OnlineWebSessionManager();
    // 加入缓存管理器
    manager.setCacheManager(getEhCacheManager());
    // 删除过期的session
    manager.setDeleteInvalidSessions(true);
    // 设置全局session超时时间
    manager.setGlobalSessionTimeout(expireTime * 60 * 1000);
    // 去掉 JSESSIONID
    manager.setSessionIdUrlRewritingEnabled(false);
    // 定义要使用的无效的Session定时调度器
    manager.setSessionValidationScheduler(SpringUtils.getBean(SpringSessionValidationScheduler.class));
    // 是否定时检查session
    manager.setSessionValidationSchedulerEnabled(true);
    // 自定义SessionDao
    manager.setSessionDAO(sessionDAO());
    // 自定义sessionFactory
    manager.setSessionFactory(sessionFactory());
    return manager;
}