Class HeaderWebSessionIdResolver
java.lang.Object
org.springframework.web.server.session.HeaderWebSessionIdResolver
- All Implemented Interfaces:
WebSessionIdResolver
Request and response header-based
WebSessionIdResolver
.- Since:
- 5.0
- Author:
- Greg Turnquist, Rob Winch
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
expireSession
(ServerWebExchange exchange) Instruct the client to end the current session.Get the configured header name.resolveSessionIds
(ServerWebExchange exchange) Resolve the session IDs associated with the request.void
setHeaderName
(String headerName) Set the name of the session header to use for the session ID.void
setSessionId
(ServerWebExchange exchange, String id) Send the given session ID to the client.
-
Field Details
-
DEFAULT_HEADER_NAME
Default value forsetHeaderName(String)
.- See Also:
-
-
Constructor Details
-
HeaderWebSessionIdResolver
public HeaderWebSessionIdResolver()
-
-
Method Details
-
setHeaderName
Set the name of the session header to use for the session ID.The name is used to extract the session ID from the request headers as well to set the session ID on the response headers.
By default set to
DEFAULT_HEADER_NAME
- Parameters:
headerName
- the header name
-
getHeaderName
Get the configured header name.- Returns:
- the configured header name
-
resolveSessionIds
Description copied from interface:WebSessionIdResolver
Resolve the session IDs associated with the request.- Specified by:
resolveSessionIds
in interfaceWebSessionIdResolver
- Parameters:
exchange
- the current exchange- Returns:
- the session IDs or an empty list
-
setSessionId
Description copied from interface:WebSessionIdResolver
Send the given session ID to the client.- Specified by:
setSessionId
in interfaceWebSessionIdResolver
- Parameters:
exchange
- the current exchangeid
- the session ID
-
expireSession
Description copied from interface:WebSessionIdResolver
Instruct the client to end the current session.- Specified by:
expireSession
in interfaceWebSessionIdResolver
- Parameters:
exchange
- the current exchange
-