Skip to main content

Class: MemorySessionStore

Defined in: service-core/src/http/session/MemorySessionStore.ts:19

Default in-process session store. Suitable for single-instance deployments; sessions do not survive a process restart and are not shared across horizontally-scaled instances — use RedisSessionStore for those cases.

Implements

Constructors

Constructor

new MemorySessionStore(): MemorySessionStore

Defined in: service-core/src/http/session/MemorySessionStore.ts:23

Returns

MemorySessionStore

Methods

destroy()

destroy(sessionId): Promise<void>

Defined in: service-core/src/http/session/MemorySessionStore.ts:42

Removes the session data for the given session ID, if any.

Parameters

sessionId

string

Returns

Promise<void>

Implementation of

SessionStore.destroy


dispose()

dispose(): void

Defined in: service-core/src/http/session/MemorySessionStore.ts:54

Stops the background sweep timer. Call when the owning SessionManager is destroyed.

Returns

void


load()

load(sessionId): Promise<Record<string, any> | undefined>

Defined in: service-core/src/http/session/MemorySessionStore.ts:28

Loads the session data for the given session ID, or undefined if none exists (or has expired).

Parameters

sessionId

string

Returns

Promise<Record<string, any> | undefined>

Implementation of

SessionStore.load


save()

save(sessionId, data, ttlSeconds): Promise<void>

Defined in: service-core/src/http/session/MemorySessionStore.ts:38

Persists the given session data, resetting its expiration to ttlSeconds from now.

Parameters

sessionId

string

data

Record<string, any>

ttlSeconds

number

Returns

Promise<void>

Implementation of

SessionStore.save