AbstractSessionManager

Base abstract class of the {@link SessionManager SessionManager} interface, enabling configuration of an application-wide {@link #getGlobalSessionTimeout() globalSessionTimeout}. Default global session timeout is {@code 30} minutes.

Constructors

this
this()
Undocumented in source.

Members

Functions

getGlobalSessionTimeout
long getGlobalSessionTimeout()

Returns the system-wide default time in milliseconds that any session may remain idle before expiring. This value is the main default for all sessions and may be overridden on a <em>per-session</em> basis by calling {@code Subject.getSession().}{@link Session#setTimeout setTimeout(long)} if so desired. <ul> <li>A negative return value means sessions never expire.</li> <li>A non-negative return value (0 or greater) means session timeout will occur as expected.</li> </ul> <p/> Unless overridden via the {@link #setGlobalSessionTimeout} method, the default value is {@link #DEFAULT_GLOBAL_SESSION_TIMEOUT}.

setGlobalSessionTimeout
void setGlobalSessionTimeout(long globalSessionTimeout)

Sets the system-wide default time in milliseconds that any session may remain idle before expiring. This value is the main default for all sessions and may be overridden on a <em>per-session</em> basis by calling {@code Subject.getSession().}{@link Session#setTimeout setTimeout(long)} if so desired. <p/> <ul> <li>A negative return value means sessions never expire.</li> <li>A non-negative return value (0 or greater) means session timeout will occur as expected.</li> </ul> <p/> Unless overridden by calling this method, the default value is {@link #DEFAULT_GLOBAL_SESSION_TIMEOUT}.

Variables

DEFAULT_GLOBAL_SESSION_TIMEOUT
enum long DEFAULT_GLOBAL_SESSION_TIMEOUT;

Default main session timeout value, equal to {@code 30} minutes.

MILLIS_PER_HOUR
enum long MILLIS_PER_HOUR;
Undocumented in source.
MILLIS_PER_MINUTE
enum long MILLIS_PER_MINUTE;
Undocumented in source.
MILLIS_PER_SECOND
enum long MILLIS_PER_SECOND;
Undocumented in source.

Inherited Members

From SessionManager

start
Session start(SessionContext context)

Starts a new session based on the specified contextual initialization data, which can be used by the underlying implementation to determine how exactly to create the internal Session instance. <p/> This method is mainly used in framework development, as the implementation will often relay the argument to an underlying {@link SessionFactory} which could use the context to construct the internal Session instance in a specific manner. This allows pluggable {@link hunt.shiro.session.Session Session} creation logic by simply injecting a {@code SessionFactory} into the {@code SessionManager} instance.

getSession
Session getSession(SessionKey key)

Retrieves the session corresponding to the specified contextual data (such as a session ID if applicable), or {@code null} if no Session could be found. If a session is found but invalid (stopped or expired), a {@link SessionException} will be thrown.

Meta