Class SpringSessionWebSessionStore<S extends Session>

java.lang.Object
org.springframework.session.web.server.session.SpringSessionWebSessionStore<S>
Type Parameters:
S - the Session type
All Implemented Interfaces:
org.springframework.web.server.session.WebSessionStore

public class SpringSessionWebSessionStore<S extends Session> extends Object implements org.springframework.web.server.session.WebSessionStore
The WebSessionStore implementation that provides the WebSession implementation backed by a Session returned by the ReactiveSessionRepository.
Since:
2.0
  • Constructor Details

  • Method Details

    • setClock

      public void setClock(Clock clock)
      Configure the Clock to use to set lastAccessTime on every created session and to calculate if it is expired.

      This may be useful to align to different timezone or to set the clock back in a test, e.g. Clock.offset(clock, Duration.ofMinutes(-31)) in order to simulate session expiration.

      By default this is Clock.system(ZoneId.of("GMT")).

      Parameters:
      clock - the clock to use
    • createWebSession

      public reactor.core.publisher.Mono<org.springframework.web.server.WebSession> createWebSession()
      Specified by:
      createWebSession in interface org.springframework.web.server.session.WebSessionStore
    • updateLastAccessTime

      public reactor.core.publisher.Mono<org.springframework.web.server.WebSession> updateLastAccessTime(org.springframework.web.server.WebSession session)
      Specified by:
      updateLastAccessTime in interface org.springframework.web.server.session.WebSessionStore
    • retrieveSession

      public reactor.core.publisher.Mono<org.springframework.web.server.WebSession> retrieveSession(String sessionId)
      Specified by:
      retrieveSession in interface org.springframework.web.server.session.WebSessionStore
    • removeSession

      public reactor.core.publisher.Mono<Void> removeSession(String sessionId)
      Specified by:
      removeSession in interface org.springframework.web.server.session.WebSessionStore