Skip to main content

Class: RedisSessionStore

Defined in: service-core/src/http/session/RedisSessionStore.ts:14

Redis-backed session store for multi-instance/production deployments, where an in-process MemorySessionStore would not be shared across horizontally-scaled instances.

Implements​

Constructors​

Constructor​

new RedisSessionStore(client): RedisSessionStore

Defined in: service-core/src/http/session/RedisSessionStore.ts:20

Parameters​

client​

RedisClientType

Returns​

RedisSessionStore

Properties​

defaultTTL​

defaultTTL: number = 60

Defined in: service-core/src/http/session/RedisSessionStore.ts:18

The default record TTL (in seconds).

Methods​

delete()​

delete(sessionId): Promise<void>

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

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

Parameters​

sessionId​

string

Returns​

Promise<void>

Implementation of​

SessionStore.delete


load()​

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

Defined in: service-core/src/http/session/RedisSessionStore.ts:24

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/RedisSessionStore.ts:34

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