public class HeaderWebSessionIdResolver extends Object implements WebSessionIdResolver
WebSessionIdResolver
.Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HEADER_NAME
Default value for
setHeaderName(String) . |
Constructor and Description |
---|
HeaderWebSessionIdResolver() |
Modifier and Type | Method and Description |
---|---|
void |
expireSession(ServerWebExchange exchange)
Instruct the client to end the current session.
|
String |
getHeaderName()
Get the configured header name.
|
List<String> |
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.
|
public static final String DEFAULT_HEADER_NAME
setHeaderName(String)
.public void setHeaderName(String headerName)
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
headerName
- the header namepublic String getHeaderName()
public List<String> resolveSessionIds(ServerWebExchange exchange)
WebSessionIdResolver
resolveSessionIds
in interface WebSessionIdResolver
exchange
- the current exchangepublic void setSessionId(ServerWebExchange exchange, String id)
WebSessionIdResolver
setSessionId
in interface WebSessionIdResolver
exchange
- the current exchangeid
- the session IDpublic void expireSession(ServerWebExchange exchange)
WebSessionIdResolver
expireSession
in interface WebSessionIdResolver
exchange
- the current exchange