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

    sessionDAO

    Fields inherited from class org.apache.shiro.session.mgt.AbstractValidatingSessionManager

    DEFAULT_SESSION_VALIDATION_INTERVAL, sessionValidationInterval, sessionValidationScheduler, sessionValidationSchedulerEnabled

    Fields inherited from class org.apache.shiro.session.mgt.AbstractSessionManager

    DEFAULT_GLOBAL_SESSION_TIMEOUT, MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_SECOND
  • Constructor Summary

    Constructors
    Constructor
    Description
    AxelorSessionManager(org.apache.shiro.session.mgt.eis.SessionDAO sessionDAO, long sessionTimeoutMinutes)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    org.apache.shiro.web.servlet.Cookie
     
    protected void
    onStart(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, setSessionIdUrlRewritingEnabled

    Methods 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, setSessionFactory

    Methods 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, validateSessions

    Methods 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, touch

    Methods inherited from class org.apache.shiro.session.mgt.AbstractSessionManager

    getGlobalSessionTimeout, setGlobalSessionTimeout

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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:
      onStart in class org.apache.shiro.web.session.mgt.DefaultWebSessionManager
    • getSessionIdCookie

      public org.apache.shiro.web.servlet.Cookie getSessionIdCookie()
      Overrides:
      getSessionIdCookie in class org.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