Returns quietly if the associated session is valid (it exists and is not stopped or expired) or throws an {@link hunt.shiro.session.InvalidSessionException} indicating that the session id is invalid. This might be preferred to be used instead of {@link #isValid} since any exception thrown will definitively explain the reason for invalidation.
Returns the object bound to the associated session identified by the specified attribute key. If there is no object bound under the attribute key for the given session, {@code null} is returned.
Returns all attribute keys maintained by the target session or an empty collection if there are no attributes.
Returns the host name or IP string of the host where the session was started, if known. If no host name or IP was specified when starting the session, this method returns {@code null}
Returns the time the associated {@code Session} last interacted with the system.
Returns the time the associated {@code Session} started (was created).
Returns the time in milliseconds that the associated session may remain idle before expiring. <ul> <li>A negative return value means the session will never expire.</li> <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that length of time.</li> </ul>
Returns {@code true} if the associated session is valid (it exists and is not stopped nor expired), {@code false} otherwise.
Removes (unbinds) the object bound to associated {@code Session} under the given {@code attributeKey}.
Binds the specified {@code value} to the associated session uniquely identified by the {@code attributeKey}. If there is already a session attribute bound under the {@code attributeKey}, that existing object will be replaced by the new {@code value}. <p/> If the {@code value} parameter is null, it has the same effect as if the {@link #removeAttribute(SessionKey sessionKey, Object attributeKey)} method was called.
Sets the time in milliseconds that the associated session may remain idle before expiring. <ul> <li>A negative return value means the session will never expire.</li> <li>A non-negative return value (0 or greater) means the session expiration will occur if idle for that length of time.</li> </ul>
Explicitly stops the associated session, thereby releasing all of its resources.
Updates the last accessed time of the session identified by <code>sessionId</code>. This can be used to explicitly ensure that a session does not time out.
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.
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.
A {@code Native} session manager is one that manages sessions natively - that is, it is directly responsible for the creation, persistence and removal of {@link hunt.shiro.session.Session Session} instances and their lifecycles.