Top Description Methods
org.springframework.web.server.session

public Interface WebSessionStore

Known Direct Implementers
org.springframework.web.server.session.InMemoryWebSessionStore
Imports
reactor.core.publisher.Mono, org.springframework.web.server.WebSession

Strategy for WebSession persistence.
Authors
Rossen Stoyanchev, Rob Winch
Since
5.0

Method Summary

Modifier and TypeMethod and Description
public Mono<WebSession>

Returns:

the created session instance
createWebSession
()

Create a new WebSession.

public Mono<Void>

Returns:

a completion notification (success or error)
removeSession
(String
the id of the session to remove
sessionId
)

Remove the WebSession for the specified id.

public Mono<WebSession>

Returns:

the session, or an empty Mono
retrieveSession
(String
the session to load
sessionId
)

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.

public Mono<WebSession>

Returns:

the session with the updated last access time
updateLastAccessTime
(WebSession
the session to update
webSession
)

Update the last accessed timestamp to "now".

Method Detail

createWebSessionback to summary
public Mono<WebSession> createWebSession()

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().

Returns:Mono<WebSession>

the created session instance

removeSessionback to summary
public Mono<Void> removeSession(String sessionId)

Remove the WebSession for the specified id.

Parameters
sessionId:String

the id of the session to remove

Returns:Mono<Void>

a completion notification (success or error)

retrieveSessionback to summary
public Mono<WebSession> retrieveSession(String sessionId)

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.

Parameters
sessionId:String

the session to load

Returns:Mono<WebSession>

the session, or an empty Mono

updateLastAccessTimeback to summary
public Mono<WebSession> updateLastAccessTime(WebSession webSession)

Update the last accessed timestamp to "now".

Parameters
webSession:WebSession

the session to update

Returns:Mono<WebSession>

the session with the updated last access time