use of org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO in project mica2 by obiba.
the class SecurityManagerFactory method initializeSessionManager.
private void initializeSessionManager(DefaultWebSecurityManager dsm) {
DefaultWebSessionManager sessionManager = new DefaultWebSessionManager();
sessionManager.setSessionDAO(new EnterpriseCacheSessionDAO());
sessionManager.setSessionValidationInterval(SESSION_VALIDATION_INTERVAL);
sessionManager.setSessionValidationSchedulerEnabled(true);
dsm.setSessionManager(sessionManager);
}
use of org.apache.shiro.session.mgt.eis.EnterpriseCacheSessionDAO in project nutzboot by nutzam.
the class ShiroEnvStarter method getWebSessionManager.
@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);
// 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"));
return webSessionManager;
}
Aggregations