public class DefaultWebSessionManager extends java.lang.Object implements WebSessionManager
WebSessionManager
delegating to a
WebSessionIdResolver
for session id resolution and to a
WebSessionStore
.Constructor and Description |
---|
DefaultWebSessionManager() |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<WebSession> |
getSession(ServerWebExchange exchange)
Return the
WebSession for the given exchange. |
WebSessionIdResolver |
getSessionIdResolver()
Return the configured
WebSessionIdResolver . |
WebSessionStore |
getSessionStore()
Return the configured
WebSessionStore . |
void |
setSessionIdResolver(WebSessionIdResolver sessionIdResolver)
Configure the id resolution strategy.
|
void |
setSessionStore(WebSessionStore sessionStore)
Configure the persistence strategy.
|
public void setSessionIdResolver(WebSessionIdResolver sessionIdResolver)
By default an instance of CookieWebSessionIdResolver
.
sessionIdResolver
- the resolver to usepublic WebSessionIdResolver getSessionIdResolver()
WebSessionIdResolver
.public void setSessionStore(WebSessionStore sessionStore)
By default an instance of InMemoryWebSessionStore
.
sessionStore
- the persistence strategy to usepublic WebSessionStore getSessionStore()
WebSessionStore
.public reactor.core.publisher.Mono<WebSession> getSession(ServerWebExchange exchange)
WebSessionManager
WebSession
for the given exchange. Always guaranteed
to return an instance either matching to the session id requested by the
client, or a new session either because the client did not specify one
or because the underlying session expired.getSession
in interface WebSessionManager
exchange
- the current exchange