Class: SessionManager
Defined in: service-core/src/http/session/SessionManager.ts:21
Owns session-ID generation/signing and store selection (in-memory by default, Redis-backed when
a cache datastore connection is available and session.store isn't forced to "memory").
Registered by Server.ts only when a session config block is present.
Constructors
Constructor
new SessionManager():
SessionManager
Returns
SessionManager
Properties
cookieName
cookieName:
string
Defined in: service-core/src/http/session/SessionManager.ts:38
cookiePath
cookiePath:
string
Defined in: service-core/src/http/session/SessionManager.ts:42
cookieSameSite
cookieSameSite:
string
Defined in: service-core/src/http/session/SessionManager.ts:41
cookieSecure
cookieSecure:
boolean
Defined in: service-core/src/http/session/SessionManager.ts:40
ttlSeconds
ttlSeconds:
number
Defined in: service-core/src/http/session/SessionManager.ts:39
Methods
destroy()
destroy(
sessionId):Promise<void>
Defined in: service-core/src/http/session/SessionManager.ts:110
Parameters
sessionId
string
Returns
Promise<void>
generateId()
generateId():
string
Defined in: service-core/src/http/session/SessionManager.ts:75
Generates a new, cryptographically random session ID.
Returns
string
load()
load(
sessionId):Promise<Record<string,any> |undefined>
Defined in: service-core/src/http/session/SessionManager.ts:102
Parameters
sessionId
string
Returns
Promise<Record<string, any> | undefined>
save()
save(
sessionId,data):Promise<void>
Defined in: service-core/src/http/session/SessionManager.ts:106
Parameters
sessionId
string
data
Record<string, any>
Returns
Promise<void>
signId()
signId(
id):string
Defined in: service-core/src/http/session/SessionManager.ts:80
Signs a session ID for safe storage in a cookie value.
Parameters
id
string
Returns
string
verifyId()
verifyId(
signed):string|undefined
Defined in: service-core/src/http/session/SessionManager.ts:89
Verifies a signed session ID cookie value, returning the original session ID if the
signature is valid, or undefined if it's missing, malformed, or tampered with.
Parameters
signed
string
Returns
string | undefined