SessionListener

Interface to be implemented by components that wish to be notified of events that occur during a {@link Session Session}'s life cycle.

Members

Functions

onExpiration
void onExpiration(Session session)

Notification callback that occurs when the corresponding Session has expired. <p/> <b>Note</b>: this method is almost never called at the exact instant that the {@code Session} expires. Almost all session management systems, including Shiro's implementations, lazily validate sessions - either when they are accessed or during a regular validation interval. It would be too resource intensive to monitor every single session instance to know the exact instant it expires. <p/> If you need to perform time-based logic when a session expires, it is best to write it based on the session's {@link hunt.shiro.session.Session#getLastAccessTime() lastAccessTime} and <em>not</em> the time when this method is called.

onStart
void onStart(Session session)

Notification callback that occurs when the corresponding Session has started.

onStop
void onStop(Session session)

Notification callback that occurs when the corresponding Session has stopped, either programmatically via {@link Session#stop} or automatically upon a subject logging out.

Meta