Closed
Description
This will allow supporting
- Add HttpSessionListener Support #4
- Disconnect WebSocket connection on Session expiration as an event #44
With the current Redis implementation, we cannot guarantee when the session expiration event is received since Redis expiration makes no guarantees. This means we will need a new strategy.
One idea is to keep track of the session expirations like this:
spring-sessions:<RedisOperationsSessionRepository-id>:<timeout-in-minutes> -> [sessionid1, sessionid2, etc]
Such that:
- RedisOperationsSessionRepository-id - is a unique id per RedisOperationsSessionRepository instance. This ensures that each RedisOperationsSessionRepository instance cleans up only sessions it created. It will also allow us to use the event as a way of closing the websocket connection for Disconnect WebSocket connection on Session expiration as an event #44
- timeout-in-minutes - this is the time that the session will expire at (rounded up to nearest minute)
A background task can then cleanup the sessions and fire events as needed.
Open questions:
- Sessions may be updated by other RedisOperationsSessionRepository instances, so how do we deal with that?
- How to we guarantee a session gets cleaned up if a server is taken down?
Metadata
Metadata
Assignees
Labels
No labels