Class DefaultWebSessionManager

  • All Implemented Interfaces:
    org.apache.shiro.cache.CacheManagerAware, org.apache.shiro.event.EventBusAware, org.apache.shiro.session.mgt.NativeSessionManager, org.apache.shiro.session.mgt.SessionManager, org.apache.shiro.session.mgt.ValidatingSessionManager, org.apache.shiro.util.Destroyable, WebSessionManager

    public class DefaultWebSessionManager
    extends org.apache.shiro.session.mgt.DefaultSessionManager
    implements WebSessionManager
    Web-application capable SessionManager implementation.
    Since:
    0.9
    • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.apache.shiro.session.Session createExposedSession​(org.apache.shiro.session.Session session, org.apache.shiro.session.mgt.SessionContext context)  
      protected org.apache.shiro.session.Session createExposedSession​(org.apache.shiro.session.Session session, org.apache.shiro.session.mgt.SessionKey key)  
      protected Serializable getSessionId​(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response)  
      Serializable getSessionId​(org.apache.shiro.session.mgt.SessionKey key)  
      Cookie getSessionIdCookie()  
      boolean isServletContainerSessions()
      This is a native session manager implementation, so this method returns false always.
      boolean isSessionIdCookieEnabled()  
      boolean isSessionIdUrlRewritingEnabled()  
      protected void onExpiration​(org.apache.shiro.session.Session s, org.apache.shiro.session.ExpiredSessionException ese, org.apache.shiro.session.mgt.SessionKey key)  
      protected void onInvalidation​(org.apache.shiro.session.Session session, org.apache.shiro.session.InvalidSessionException ise, org.apache.shiro.session.mgt.SessionKey key)  
      protected void onStart​(org.apache.shiro.session.Session session, org.apache.shiro.session.mgt.SessionContext context)
      Stores the Session's ID, usually as a Cookie, to associate with future requests.
      protected void onStop​(org.apache.shiro.session.Session session, org.apache.shiro.session.mgt.SessionKey key)  
      void setSessionIdCookie​(Cookie sessionIdCookie)  
      void setSessionIdCookieEnabled​(boolean sessionIdCookieEnabled)  
      void setSessionIdUrlRewritingEnabled​(boolean sessionIdUrlRewritingEnabled)  
      • 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 interface org.apache.shiro.session.mgt.SessionManager

        getSession, start
    • Constructor Detail

      • DefaultWebSessionManager

        public DefaultWebSessionManager()
    • Method Detail

      • getSessionIdCookie

        public Cookie getSessionIdCookie()
      • setSessionIdCookie

        public void setSessionIdCookie​(Cookie sessionIdCookie)
      • isSessionIdCookieEnabled

        public boolean isSessionIdCookieEnabled()
      • setSessionIdCookieEnabled

        public void setSessionIdCookieEnabled​(boolean sessionIdCookieEnabled)
      • isSessionIdUrlRewritingEnabled

        public boolean isSessionIdUrlRewritingEnabled()
      • setSessionIdUrlRewritingEnabled

        public void setSessionIdUrlRewritingEnabled​(boolean sessionIdUrlRewritingEnabled)
      • createExposedSession

        protected org.apache.shiro.session.Session createExposedSession​(org.apache.shiro.session.Session session,
                                                                        org.apache.shiro.session.mgt.SessionContext context)
        Overrides:
        createExposedSession in class org.apache.shiro.session.mgt.AbstractNativeSessionManager
      • createExposedSession

        protected org.apache.shiro.session.Session createExposedSession​(org.apache.shiro.session.Session session,
                                                                        org.apache.shiro.session.mgt.SessionKey key)
        Overrides:
        createExposedSession in class org.apache.shiro.session.mgt.AbstractNativeSessionManager
      • onStart

        protected void onStart​(org.apache.shiro.session.Session session,
                               org.apache.shiro.session.mgt.SessionContext context)
        Stores the Session's ID, usually as a Cookie, to associate with future requests.
        Overrides:
        onStart in class org.apache.shiro.session.mgt.AbstractNativeSessionManager
        Parameters:
        session - the session that was just created.
      • getSessionId

        public Serializable getSessionId​(org.apache.shiro.session.mgt.SessionKey key)
        Overrides:
        getSessionId in class org.apache.shiro.session.mgt.DefaultSessionManager
      • getSessionId

        protected Serializable getSessionId​(javax.servlet.ServletRequest request,
                                            javax.servlet.ServletResponse response)
      • onExpiration

        protected void onExpiration​(org.apache.shiro.session.Session s,
                                    org.apache.shiro.session.ExpiredSessionException ese,
                                    org.apache.shiro.session.mgt.SessionKey key)
        Overrides:
        onExpiration in class org.apache.shiro.session.mgt.AbstractValidatingSessionManager
      • onInvalidation

        protected void onInvalidation​(org.apache.shiro.session.Session session,
                                      org.apache.shiro.session.InvalidSessionException ise,
                                      org.apache.shiro.session.mgt.SessionKey key)
        Overrides:
        onInvalidation in class org.apache.shiro.session.mgt.AbstractValidatingSessionManager
      • onStop

        protected void onStop​(org.apache.shiro.session.Session session,
                              org.apache.shiro.session.mgt.SessionKey key)
        Overrides:
        onStop in class org.apache.shiro.session.mgt.AbstractNativeSessionManager
      • isServletContainerSessions

        public boolean isServletContainerSessions()
        This is a native session manager implementation, so this method returns false always.
        Specified by:
        isServletContainerSessions in interface WebSessionManager
        Returns:
        false always
        Since:
        1.2