Class SpringSessionWebSessionStore<S extends Session>
java.lang.Object
org.springframework.session.web.server.session.SpringSessionWebSessionStore<S>
- Type Parameters:
S
- theSession
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 Summary
ConstructorDescriptionSpringSessionWebSessionStore
(ReactiveSessionRepository<S> reactiveSessionRepository) -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<org.springframework.web.server.WebSession>
reactor.core.publisher.Mono<Void>
removeSession
(String sessionId) reactor.core.publisher.Mono<org.springframework.web.server.WebSession>
retrieveSession
(String sessionId) void
Configure theClock
to use to set lastAccessTime on every created session and to calculate if it is expired.reactor.core.publisher.Mono<org.springframework.web.server.WebSession>
updateLastAccessTime
(org.springframework.web.server.WebSession session)
-
Constructor Details
-
SpringSessionWebSessionStore
-
-
Method Details
-
setClock
Configure theClock
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 interfaceorg.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 interfaceorg.springframework.web.server.session.WebSessionStore
-
retrieveSession
public reactor.core.publisher.Mono<org.springframework.web.server.WebSession> retrieveSession(String sessionId) - Specified by:
retrieveSession
in interfaceorg.springframework.web.server.session.WebSessionStore
-
removeSession
- Specified by:
removeSession
in interfaceorg.springframework.web.server.session.WebSessionStore
-