Interface SessionStore

All Known Implementing Classes:
FileSessionStore, InMemorySessionStore

public interface SessionStore
Interface for session persistence. Implementations handle creation, retrieval, and storage of user sessions.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(int expirySeconds)
    Create a new session with the specified expiry time.
    void
    Delete a session from the store.
    get(String id)
    Retrieve a session by its ID.
    void
    save(Session session)
    Save/update a session in the store.
  • Method Details

    • create

      Session create(int expirySeconds)
      Create a new session with the specified expiry time.
      Parameters:
      expirySeconds - number of seconds until the session expires
      Returns:
      newly created session with unique ID
    • get

      Session get(String id)
      Retrieve a session by its ID.
      Parameters:
      id - the session ID
      Returns:
      the session if found and not expired, null otherwise
    • save

      void save(Session session)
      Save/update a session in the store.
      Parameters:
      session - the session to save
    • delete

      void delete(String id)
      Delete a session from the store.
      Parameters:
      id - the session ID to delete