Top Description Fields Constructors Methods
org.springframework.web.server.session

public Class HeaderWebSessionIdResolver

extends Object
implements WebSessionIdResolver
Class Inheritance
All Implemented Interfaces
org.springframework.web.server.session.WebSessionIdResolver
Imports
java.util.Collections, .List, org.springframework.http.HttpHeaders, org.springframework.util.Assert, org.springframework.web.server.ServerWebExchange

Request and response header-based WebSessionIdResolver.
Authors
Greg Turnquist, Rob Winch
Since
5.0

Field Summary

Modifier and TypeField and Description
public static final String
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
expireSession(ServerWebExchange
the current exchange
exchange
)

Implements org.springframework.web.server.session.WebSessionIdResolver.expireSession.

Instruct the client to end the current session.
public String

Returns:

the configured header name
getHeaderName
()

Get the configured header name.

public List<String>
resolveSessionIds(ServerWebExchange
the current exchange
exchange
)

Implements org.springframework.web.server.session.WebSessionIdResolver.resolveSessionIds.

Resolve the session IDs associated with the request.
public void
setHeaderName(String
the header name
headerName
)

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.

public void
setSessionId(ServerWebExchange
the current exchange
exchange
,
String
the session ID
id
)

Implements org.springframework.web.server.session.WebSessionIdResolver.setSessionId.

Send the given session ID to the client.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_HEADER_NAMEback to summary
public static final String DEFAULT_HEADER_NAME

Default value for setHeaderName(String).

headerNameback to summary
private String headerName

Constructor Detail

HeaderWebSessionIdResolverback to summary
public HeaderWebSessionIdResolver()

Method Detail

expireSessionback to summary
public void expireSession(ServerWebExchange exchange)

Implements org.springframework.web.server.session.WebSessionIdResolver.expireSession.

Doc from org.springframework.web.server.session.WebSessionIdResolver.expireSession.

Instruct the client to end the current session.

Parameters
exchange:ServerWebExchange

the current exchange

Annotations
@Override
getHeaderNameback to summary
public String getHeaderName()

Get the configured header name.

Returns:String

the configured header name

resolveSessionIdsback to summary
public List<String> resolveSessionIds(ServerWebExchange exchange)

Implements org.springframework.web.server.session.WebSessionIdResolver.resolveSessionIds.

Doc from org.springframework.web.server.session.WebSessionIdResolver.resolveSessionIds.

Resolve the session IDs associated with the request.

Parameters
exchange:ServerWebExchange

the current exchange

Returns:List<String>

the session IDs or an empty list

Annotations
@Override
setHeaderNameback to summary
public void setHeaderName(String headerName)

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:String

the header name

setSessionIdback to summary
public void setSessionId(ServerWebExchange exchange, String id)

Implements org.springframework.web.server.session.WebSessionIdResolver.setSessionId.

Doc from org.springframework.web.server.session.WebSessionIdResolver.setSessionId.

Send the given session ID to the client.

Parameters
exchange:ServerWebExchange

the current exchange

id:String

the session ID

Annotations
@Override