Class SpringSessionWebSessionStore<S extends Session>
java.lang.Object
org.springframework.session.web.server.session.SpringSessionWebSessionStore<S>
- Type Parameters:
S- theSessiontype
- 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
ConstructorsConstructorDescriptionSpringSessionWebSessionStore(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) voidConfigure theClockto 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 theClockto 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:
createWebSessionin 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:
updateLastAccessTimein interfaceorg.springframework.web.server.session.WebSessionStore
-
retrieveSession
public reactor.core.publisher.Mono<org.springframework.web.server.WebSession> retrieveSession(String sessionId) - Specified by:
retrieveSessionin interfaceorg.springframework.web.server.session.WebSessionStore
-
removeSession
- Specified by:
removeSessionin interfaceorg.springframework.web.server.session.WebSessionStore
-