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.
delete(key:string):Promise<void>
Removes a session from the store.
| Parameter | Type | Description |
|---|---|---|
key | string | Unique identifier of the session to delete. |
Promise<void>
Retrieves a session associated with the provided key.
| Parameter | Type | Description |
|---|---|---|
key | string | Unique identifier of the session. |
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.
| Parameter | Type | Description |
|---|---|---|
key | string | Unique identifier of the session. |
data | MonoCloudSession | The session data to persist. |
lifetime | SessionLifetime | Session lifetime metadata (creation, update, expiration). |
Promise<void>