Class DefaultwebSessionManager
java.lang.Object
org.springframework.web.server.session.DefaultwebSessionManager
- All Implemented Interfaces:
webSessionManager
Default implementation of
webSessionManager delegating to a
webSessionIdResolver for session id resolution and to a
webSessionStore.- Since:
- 5.0
- Author:
- Rossen Stoyanchev, Rob Winch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<webSession> getSession(ServerwebExchange exchange) Return thewebSessionfor the given exchange.Return the configuredwebSessionIdResolver.Return the configuredwebSessionStore.voidsetSessionIdResolver(webSessionIdResolver sessionIdResolver) Configure the id resolution strategy.voidsetSessionStore(webSessionStore sessionStore) Configure the persistence strategy.
-
Constructor Details
-
DefaultwebSessionManager
public DefaultwebSessionManager()
-
-
Method Details
-
setSessionIdResolver
Configure the id resolution strategy.By default an instance of
CookiewebSessionIdResolver.- Parameters:
sessionIdResolver- the resolver to use
-
getSessionIdResolver
Return the configuredwebSessionIdResolver. -
setSessionStore
Configure the persistence strategy.By default an instance of
InMemorywebSessionStore.- Parameters:
sessionStore- the persistence strategy to use
-
getSessionStore
Return the configuredwebSessionStore. -
getSession
Description copied from interface:webSessionManagerReturn thewebSessionfor the given exchange.Always guaranteed to return either an instance matching the session id requested by the client, or a new session either because the client did not specify a session id or because the underlying session expired.
- Specified by:
getSessionin interfacewebSessionManager- Parameters:
exchange- the current exchange- Returns:
- promise for the webSession
-