MonoCloud Authentication SDK
    Preparing search index...

    Interface MonoCloudSessionStore

    Defines a storage adapter used to persist authentication sessions.

    Implement this interface to store sessions outside the default cookie-based storage — for example in Redis, a database, or a distributed cache.

    interface MonoCloudSessionStore {
        delete(key: string): Promise<void>;
        get(key: string): Promise<MonoCloudSession | null | undefined>;
        set(
            key: string,
            data: MonoCloudSession,
            lifetime: SessionLifetime,
        ): Promise<void>;
    }
    Index
    • Removes a session from the store.

      Parameters

      • key: string

        Unique identifier of the session to delete.

      Returns Promise<void>

    • Retrieves a session associated with the provided key.

      Parameters

      • key: string

        Unique identifier of the session.

      Returns Promise<MonoCloudSession | null | undefined>

      Returns the stored session, or undefined / null if no session exists.

    • Persists or updates a session.

      The provided lifetime information can be used by the store to configure TTL/expiration policies.

      Parameters

      • key: string

        Unique identifier of the session.

      • data: MonoCloudSession

        The session data to persist.

      • lifetime: SessionLifetime

        Session lifetime metadata (creation, update, expiration).

      Returns Promise<void>