| Modifier and Type | Class and Description |
|---|---|
| public static record | |
| private class | AbstractSessionManager.
StreamWrapper to intercept commit and complete events to ensure session handling happens in context, with request available. |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private boolean | |
| private Context | |
| private int | _dftMaxIdleSecs
Setting of max inactive interval for new sessions -1 means no timeout |
| private ClassLoader | |
| private boolean | |
| private int | |
| private Scheduler | |
| private boolean | |
| private SessionCache | |
| private SessionContext | |
| private String | |
| private final Map | |
| private Map | |
| private SessionIdManager | |
| private String | |
| private String | |
| private List | |
| private final CounterStatistic | |
| private final SampleStatistic | |
| private boolean | |
| private boolean | |
| pack-priv static final Logger | |
| private static final AbstractSessionManager. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public HttpCookie | Returns: the session cookie. If not null, this cookie should be set on the response to either migrate the session or to refresh a session cookie that may expire.the session object session, boolean whether the request is secure or not secure)Called when a session is first accessed by request processing. |
| protected void | |
| public long | Returns: the time remaining before expiry or inactivity timeoutthe ID of the session id, long The time in milliseconds remaining before this session is considered Idle timeRemainingMs, long The maximum time in milliseconds that a session may be idle. maxInactiveMs)Implements org. Calculate what the session timer setting should be based on: the time remaining before the session expires and any idle eviction time configured. |
| public void | commit(ManagedSession session)
Implements org. Called when a response is about to be committed. |
| public void | complete(ManagedSession
the session object session)Implements org. Called when a request is finally leaving a session. |
| public void | doStart()
Overrides org. Starts the managed lifecycle beans in the order they were added. |
| protected void | doStop()
Overrides org. Stops the managed lifecycle beans in the reverse order they were added. |
| private static String | duplicateSession(String id0, boolean valid0, boolean cookie0, String id1, boolean valid1, boolean cookie1)
|
| public String | encodeURI(Request request, String uri, boolean cookiesInUse)
Implements org.
|
| public Context | |
| public ManagedSession | Returns: the Session matching the id or null if none existsThe session id, possibly imcluding worker name suffix. extendedId)Implements org. Get a known existing session |
| public int | |
| public int | getMaxInactiveInterval()
Implements org. Returns: the max period of inactivity, after which the session is invalidated, in seconds. |
| public int | |
| public HttpCookie. | |
| public abstract Server | |
| public SessionCache | getSessionCache()
Implements org. Returns: the session cache |
| public String | |
| public SessionContext | |
| public String | |
| public HttpCookie | Returns: if thisSessionManager uses cookies, then this method will return a new
cookie object that should be set on the client in order to link future HTTP requests
with the session. If cookies are not in use, this method returns null.the session to which the cookie should refer. session, boolean whether the client is accessing the server over a secure protocol (i.e. HTTPS). requestIsSecure)Implements org. A session cookie is marked as secure IFF any of the following conditions are true:
|
| public String | |
| public Map | getSessionCookieAttributes()
Returns: all of the cookie config attributes EXCEPT for those that have explicit setter/getters |
| public String | |
| public SessionIdManager | |
| public String | getSessionIdPathParameterName()
Implements org. Returns: the URL path parameter name for session id URL rewriting, by default "jsessionid". |
| public String | getSessionIdPathParameterNamePrefix()
Implements org. Returns: a formatted version of |
| public String | |
| public int | |
| public double | getSessionTimeMean()
Implements org. Returns: mean amount of time session remained valid |
| public double | getSessionTimeStdDev()
Implements org. Returns: standard deviation of amount of time session remained valid |
| public long | getSessionTimeTotal()
Implements org. Returns: total amount of time all sessions remained valid |
| public void | invalidate(String
the session id to invalidate id)Implements org. Called by SessionIdManager to remove a session that has been invalidated, either by this context or another context. |
| public boolean | isCheckingRemoteSessionIdEncoding()
Implements org. Returns: True if absolute URLs are check for remoteness before being session encoded. |
| public boolean | isHttpOnly()
Implements org. Returns: true if session cookies should be HTTP only |
| public boolean | Returns: true if this manager knows about this ididentity of session to check id)Implements org. Check if id is in use by this context |
| public boolean | isPartitioned()
Implements org. Returns: true if session cookies should have the |
| public boolean | isSecureCookies()
Implements org. Returns: same as SessionCookieConfig.getSecure(). |
| public boolean | isSecureRequestOnly()
Implements org. Returns: true if session cookie is to be marked as secure only on HTTPS requests |
| public boolean | isUsingCookies()
Implements org. Returns: true if using session cookies is allowed, false otherwise |
| public boolean | isUsingUriParameters()
Implements org. Returns: whether the session management is handled via URLs. |
| public boolean | isUsingURLs()
Deprecated
for removal since 12.0.1. use
isUsingUriParameters() instead, will be removed in Jetty 12.1.0
|
| public void | newSession(Request
the inbound request request, String the session id used by the request requestedSessionId, Consumer<ManagedSession> consumer)Implements org. Create a new Session, using the requested session id if possible. |
| public SessionInactivityTimer | newSessionInactivityTimer(ManagedSession
the session to time session)Implements org. Make a new timer for the session. |
| public void | onSessionCreated(Session session)
Overrides default org.
|
| public void | onSessionDestroyed(Session session)
Overrides default org.
|
| public void | onSessionIdChanged(Session session, String oldId)
Overrides default org.
|
| public void | recordSessionTime(ManagedSession
the session whose time to record session)Implements org. Record length of time session has been active. |
| public void | renewSessionId(String
the old session id oldId, String the session id including worker suffix oldExtendedId, String the new session id newId, String the new session id including worker suffix newExtendedId)Implements org. Change the existing session id. |
| protected AbstractSessionManager. | resolveRequestedSessionId(Request
The request from which to obtain the ID request)Find any Session associated with the Request. |
| public void | scavenge()
Implements org. Called periodically by the HouseKeeper to handle the list of sessions that have expired since the last call to scavenge. |
| private void | |
| public void | sessionTimerExpired(ManagedSession
the session session, long the time at which to check for expiry now)Implements org. Each session has a timer that is configured to go off when either the session has not been accessed for a configurable amount of time, or the session itself has passed its expiry. |
| public void | setCheckingRemoteSessionIdEncoding(boolean
True if absolute URLs are check for remoteness before being session encoded. remote)Implements org.
|
| public void | setHttpOnly(boolean
True if cookies should be HttpOnly. httpOnly)Implements org. Set if Session cookies should use HTTP Only |
| public void | setMaxCookieAge(int maxCookieAge)
Implements org.
|
| public void | setMaxInactiveInterval(int
the max inactivity period, in seconds. If less than or equal to zero, then the session is immortal seconds)Implements org. Sets the max period of inactivity, after which the session is invalidated, in seconds. |
| public void | setPartitioned(boolean
whether session cookies should have the partitioned)Partitioned attributeImplements org. Sets whether session cookies should have the |
| public void | setRefreshCookieAge(int ageInSeconds)
Implements org.
|
| public void | setSameSite(HttpCookie.
Implements org.
|
| public void | setSecureCookies(boolean secure)
Implements org.
|
| public void | setSecureRequestOnly(boolean
true to set Session Cookie Config as secure secureRequestOnly)Implements org. HTTPS request. |
| public void | setSessionCache(SessionCache
the SessionCache to use cache)Implements org. Set up the SessionCache. |
| public void | setSessionComment(String sessionComment)
Implements org.
|
| public void | setSessionCookie(String cookieName)
Implements org.
|
| public void | |
| public void | |
| public void | setSessionIdManager(SessionIdManager
The sessionIdManager used for cross context session management. sessionIdManager)Implements org. Set up the SessionIdManager. |
| public void | setSessionIdPathParameterName(String
the URL path parameter name for session id URL rewriting (null or "none" for no rewriting). param)Implements org. Sets the session id URL path parameter name. |
| public void | setSessionPath(String sessionPath)
Implements org.
|
| public void | setUsingCookies(boolean
true if cookies are used to track sessions usingCookies)Implements org.
|
| public void | setUsingUriParameters(boolean usingUriParameters)
Implements org.
|
| public void | setUsingURLs(boolean usingURLs)
Deprecated
for removal since 12.0.1. use
setUsingUriParameters(boolean) instead, will be removed in Jetty 12.1.0
|
| private void |