Closed TomYule closed 5 years ago
希望能支持 配置文件覆盖 原来的sessionDAO EnterpriseCacheSessionDAO sessionDAO = new EnterpriseCacheSessionDAO();
@IocBean(name = "shiroWebSessionManager") public WebSessionManager getWebSessionManager() { DefaultWebSessionManager webSessionManager = conf.make(DefaultWebSessionManager.class, "shiro.session.manager."); // 带缓存的shiro会话 EnterpriseCacheSessionDAO sessionDAO = new EnterpriseCacheSessionDAO(); sessionDAO.setSessionIdGenerator(new UU32SessionIdGenerator()); webSessionManager.setSessionDAO(sessionDAO); //设置session会话超时时间 webSessionManager.setGlobalSessionTimeout(conf.getLong(PROP_SESSION_MANAGER_GLOBALSESSIONTIMEOUT, 1800000)); webSessionManager.setSessionValidationSchedulerEnabled(conf.getBoolean(PROP_SESSION_MANAGER_SVSE, true)); webSessionManager.setSessionValidationInterval(conf.getLong(PROP_SESSION_MANAGER_SVI, 3600000)); // cookie conf.putIfAbsent(PROP_SESSION_COOKIE_NAME, "sid"); conf.putIfAbsent(PROP_SESSION_COOKIE_MAXAGE, "946080000"); conf.putIfAbsent(PROP_SESSION_COOKIE_HTTPONLY, "true"); SimpleCookie cookie = conf.make(SimpleCookie.class, "shiro.session.cookie."); webSessionManager.setSessionIdCookie(cookie); webSessionManager.setSessionIdCookieEnabled(true); webSessionManager.setCacheManager(ioc.get(CacheManager.class, "shiroCacheManager")); webSessionManager.setSessionListeners(appContext.getBeans(SessionListener.class)); return webSessionManager; }
希望能支持 配置文件覆盖 原来的sessionDAO EnterpriseCacheSessionDAO sessionDAO = new EnterpriseCacheSessionDAO();