Package com.axelor.auth.pac4j
Class AxelorSessionManager
java.lang.Object
org.apache.shiro.session.mgt.AbstractSessionManager
org.apache.shiro.session.mgt.AbstractNativeSessionManager
org.apache.shiro.session.mgt.AbstractValidatingSessionManager
org.apache.shiro.session.mgt.DefaultSessionManager
org.apache.shiro.web.session.mgt.DefaultWebSessionManager
com.axelor.auth.pac4j.AxelorSessionManager
- All Implemented Interfaces:
org.apache.shiro.cache.CacheManagerAware,org.apache.shiro.event.EventBusAware,org.apache.shiro.lang.util.Destroyable,org.apache.shiro.session.mgt.NativeSessionManager,org.apache.shiro.session.mgt.SessionManager,org.apache.shiro.session.mgt.ValidatingSessionManager,org.apache.shiro.web.session.mgt.WebSessionManager
@Singleton
public class AxelorSessionManager
extends org.apache.shiro.web.session.mgt.DefaultWebSessionManager
Session Manager
Uses SameSite attribute for secure requests.
-
Field Summary
Fields inherited from class org.apache.shiro.session.mgt.DefaultSessionManager
sessionDAOFields inherited from class org.apache.shiro.session.mgt.AbstractValidatingSessionManager
DEFAULT_SESSION_VALIDATION_INTERVAL, sessionValidationInterval, sessionValidationScheduler, sessionValidationSchedulerEnabledFields inherited from class org.apache.shiro.session.mgt.AbstractSessionManager
DEFAULT_GLOBAL_SESSION_TIMEOUT, MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_SECOND -
Constructor Summary
ConstructorsConstructorDescriptionAxelorSessionManager(org.apache.shiro.session.mgt.eis.SessionDAO sessionDAO, long sessionTimeoutMinutes) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.shiro.session.SessiongetSession(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Gets session from request and response if it exists.org.apache.shiro.web.servlet.Cookieprotected voidonStart(org.apache.shiro.session.Session session, org.apache.shiro.session.mgt.SessionContext context) Methods inherited from class org.apache.shiro.web.session.mgt.DefaultWebSessionManager
createExposedSession, createExposedSession, getSessionId, getSessionId, isServletContainerSessions, isSessionIdCookieEnabled, isSessionIdUrlRewritingEnabled, onExpiration, onInvalidation, onStop, setSessionIdCookie, setSessionIdCookieEnabled, setSessionIdUrlRewritingEnabledMethods inherited from class org.apache.shiro.session.mgt.DefaultSessionManager
afterExpired, afterStopped, create, delete, doCreateSession, getActiveSessions, getSessionDAO, getSessionFactory, isDeleteInvalidSessions, newSessionInstance, onChange, onExpiration, onStop, retrieveSession, retrieveSessionFromDataSource, setCacheManager, setDeleteInvalidSessions, setSessionDAO, setSessionFactoryMethods inherited from class org.apache.shiro.session.mgt.AbstractValidatingSessionManager
afterSessionValidationEnabled, beforeSessionValidationDisabled, createSession, createSessionValidationScheduler, destroy, disableSessionValidation, doGetSession, doValidate, enableSessionValidation, getSessionValidationInterval, getSessionValidationScheduler, getTimeout, isSessionValidationSchedulerEnabled, setSessionValidationInterval, setSessionValidationScheduler, setSessionValidationSchedulerEnabled, validate, validateSessionsMethods inherited from class org.apache.shiro.session.mgt.AbstractNativeSessionManager
applyGlobalSessionTimeout, beforeInvalidNotification, checkValid, getAttribute, getAttributeKeys, getEventBus, getHost, getLastAccessTime, getSession, getSessionListeners, getStartTimestamp, getTimeout, isValid, notifyExpiration, notifyStart, notifyStop, publishEvent, removeAttribute, setAttribute, setEventBus, setSessionListeners, setTimeout, start, stop, touchMethods inherited from class org.apache.shiro.session.mgt.AbstractSessionManager
getGlobalSessionTimeout, setGlobalSessionTimeoutMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.shiro.session.mgt.SessionManager
getSession, start
-
Constructor Details
-
AxelorSessionManager
@Inject public AxelorSessionManager(org.apache.shiro.session.mgt.eis.SessionDAO sessionDAO, @Named("session.timeout") long sessionTimeoutMinutes)
-
-
Method Details
-
onStart
protected void onStart(org.apache.shiro.session.Session session, org.apache.shiro.session.mgt.SessionContext context) - Overrides:
onStartin classorg.apache.shiro.web.session.mgt.DefaultWebSessionManager
-
getSessionIdCookie
public org.apache.shiro.web.servlet.Cookie getSessionIdCookie()- Overrides:
getSessionIdCookiein classorg.apache.shiro.web.session.mgt.DefaultWebSessionManager
-
getSession
@Nullable public org.apache.shiro.session.Session getSession(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Gets session from request and response if it exists.Normally, you can use
Subject.getSession().This is for cases where security manager is not available.
- Parameters:
request-response-- Returns:
- session or null
-