spring-framework / org.springframework.web.server.session / WebSessionStore

WebSessionStore

interface WebSessionStore

Strategy for WebSession persistence.

Author
Rossen Stoyanchev

Author
Rob Winch

Since
5.0

Functions

createWebSession

abstract fun createWebSession(): Mono<WebSession>

Create a new WebSession.

Note that this does nothing more than create a new instance. The session can later be started explicitly via WebSession#start() or implicitly by adding attributes -- and then persisted via WebSession#save().

removeSession

abstract fun removeSession(sessionId: String): Mono<Void>

Remove the WebSession for the specified id.

retrieveSession

abstract fun retrieveSession(sessionId: String): Mono<WebSession>

Return the WebSession for the given id.

Note: This method should perform an expiration check, and if it has expired remove the session and return empty. This method should also update the lastAccessTime of retrieved sessions.

updateLastAccessTime

abstract fun updateLastAccessTime(webSession: WebSession): Mono<WebSession>

Update the last accessed timestamp to "now".

Inheritors

InMemoryWebSessionStore

open class InMemoryWebSessionStore : WebSessionStore

Simple Map-based storage for WebSession instances.