Class CompositeHttpSessionIdResolver
java.lang.Object
org.springframework.session.web.http.CompositeHttpSessionIdResolver
- All Implemented Interfaces:
HttpSessionIdResolver
Composite
HttpSessionIdResolver implementation that iterates over a given
collection of delegate HttpSessionIdResolver instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexpireSession(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Instruct the client to end the current session.resolveSessionIds(jakarta.servlet.http.HttpServletRequest request) Resolve the session ids associated with the providedHttpServletRequest.voidsetSessionId(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sessionId) Send the given session id to the client.
-
Constructor Details
-
CompositeHttpSessionIdResolver
-
-
Method Details
-
resolveSessionIds
Resolve the session ids associated with the providedHttpServletRequest. For example, the session id might come from a cookie or a request header.- Specified by:
resolveSessionIdsin interfaceHttpSessionIdResolver- Parameters:
request- the current request- Returns:
- the session ids
-
setSessionId
public void setSessionId(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String sessionId) Send the given session id to the client. This method is invoked when a new session is created and should inform a client what the new session id is. For example, it might create a new cookie with the session id in it or set an HTTP response header with the value of the new session id.- Specified by:
setSessionIdin interfaceHttpSessionIdResolver- Parameters:
request- the current requestresponse- the current responsesessionId- the session id
-
expireSession
public void expireSession(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Instruct the client to end the current session. This method is invoked when a session is invalidated and should inform a client that the session id is no longer valid. For example, it might remove a cookie with the session id in it or set an HTTP response header with an empty value indicating to the client to no longer submit that session id.- Specified by:
expireSessionin interfaceHttpSessionIdResolver- Parameters:
request- the current requestresponse- the current response
-