Interface RedisSessionExpirationStore

All Known Implementing Classes:
SortedSetRedisSessionExpirationStore

public interface RedisSessionExpirationStore
An interface for storing RedisIndexedSessionRepository.RedisSession instances with their expected expiration time. This approach is necessary because Redis does not guarantee when the expired event will be fired if the key has not been accessed. For more details, see the Redis documentation on how keys expire. To address the uncertainty of expired events, sessions can be stored with their expected expiration time, ensuring each key is accessed when it is expected to expire. This interface defines common operations for tracking sessions and their expiration times, and allows for a strategy to clean up expired sessions.
Since:
3.4
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Performs clean up on the expired sessions.
    void
    remove(String sessionId)
    Removes the session id from the expiration store.
    void
    Saves the session and its expected expiration time, so it can be found later on by its expiration time in order for clean up to happen.
  • Method Details

    • save

      Saves the session and its expected expiration time, so it can be found later on by its expiration time in order for clean up to happen.
      Parameters:
      session - the session to save
    • remove

      void remove(String sessionId)
      Removes the session id from the expiration store.
      Parameters:
      sessionId - the session id
    • cleanupExpiredSessions

      void cleanupExpiredSessions()
      Performs clean up on the expired sessions.