Package org.apache.shiro.session.mgt
Interface SessionKey
-
- All Known Implementing Classes:
DefaultSessionKey
public interface SessionKey
ASessionKey
is a key that allows look-up of any particularSession
instance. This is not to be confused what is probably better recognized as a session attribute key - a key that is used to acquire a session attribute via theSession.getAttribute
method. ASessionKey
looks up a Session object directly. While aSessionKey
allows lookup of any Session that might exist, this is not something in practice done too often by most Shiro end-users. Instead, it is usually more convenient to acquire the currently executingSubject
's session via theSubject.getSession()
method. This interface and its usages are best suited for framework development.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Serializable
getSessionId()
Returns the id of the session to acquire.
-
-
-
Method Detail
-
getSessionId
Serializable getSessionId()
Returns the id of the session to acquire. Acquiring sessions by ID only is a suitable strategy when sessions are natively managed by Shiro directly. For example, the Servlet specification does not have an API that allows session acquisition by session ID, so the session ID alone is not sufficient for ServletContainer-based SessionManager implementations.- Returns:
- the id of the session to acquire.
-
-