Class DefaultwebSessionManager

java.lang.Object
org.springframework.web.server.session.DefaultwebSessionManager
All Implemented Interfaces:
webSessionManager

public class DefaultwebSessionManager extends Object implements 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 Details

    • DefaultwebSessionManager

      public DefaultwebSessionManager()
  • Method Details

    • setSessionIdResolver

      public void setSessionIdResolver(webSessionIdResolver sessionIdResolver)
      Configure the id resolution strategy.

      By default an instance of CookiewebSessionIdResolver.

      Parameters:
      sessionIdResolver - the resolver to use
    • getSessionIdResolver

      public webSessionIdResolver getSessionIdResolver()
      Return the configured webSessionIdResolver.
    • setSessionStore

      public void setSessionStore(webSessionStore sessionStore)
      Configure the persistence strategy.

      By default an instance of InMemorywebSessionStore.

      Parameters:
      sessionStore - the persistence strategy to use
    • getSessionStore

      public webSessionStore getSessionStore()
      Return the configured webSessionStore.
    • getSession

      public reactor.core.publisher.Mono<webSession> getSession(ServerwebExchange exchange)
      Description copied from interface: webSessionManager
      Return the webSession for 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:
      getSession in interface webSessionManager
      Parameters:
      exchange - the current exchange
      Returns:
      promise for the webSession