MemorySiwxSessionStore
Defined in: siwx-server/src/server.ts:439
In-memory SiwxSessionStore for local development and tests. Sessions live in a Map of the current
process: they are lost on restart and not shared between instances or serverless invocations. Session IDs are
32-character hex strings from generateNonce.
Implements
Constructors
Constructor
new MemorySiwxSessionStore(
options?):MemorySiwxSessionStore
Defined in: siwx-server/src/server.ts:447
Parameters
options?
Store options.
allowInProduction?
boolean
Allows the store when NODE_ENV is production.
Returns
MemorySiwxSessionStore
Throws
When process.env.NODE_ENV is production and allowInProduction is not true.
Methods
bindSubject()
bindSubject(
id,subjectId):Promise<boolean>
Defined in: siwx-server/src/server.ts:482
Binds one of your user IDs to the session. Not called by SIWX; use it after sign-in to link the wallet session to your own user record.
Parameters
id
string
The session ID.
subjectId
string
The user or subject ID.
Returns
Promise<boolean>
true if the session exists and was updated, false otherwise.
Implementation of
create()
create(
input):Promise<SiwxSessionRecord>
Defined in: siwx-server/src/server.ts:458
Creates and stores a new session record.
Parameters
input
The session to store.
session
The verified session data.
ttlSeconds
number
Time-to-live in seconds.
Returns
Promise<SiwxSessionRecord>
The created record. Its id must be unguessable, because it becomes the session cookie value.
Implementation of
get()
get(
id):Promise<SiwxSessionRecord|null>
Defined in: siwx-server/src/server.ts:472
Retrieves a session record by its ID. Session expiry is enforced here: SIWX does not compare expiresAt itself.
Parameters
id
string
The session ID.
Returns
Promise<SiwxSessionRecord | null>
The session record, or null if it does not exist or has expired.
Implementation of
revoke()
revoke(
id):Promise<void>
Defined in: siwx-server/src/server.ts:489
Revokes a session. Must succeed when the session does not exist.
Parameters
id
string
The session ID.
Returns
Promise<void>
A promise that resolves once the session is removed.