LogoRobo.js
Packages@robojs/mock

SessionManager

Class: SessionManager

Manages session lifecycle and storage

Constructors

new SessionManager()

new SessionManager(options?): SessionManager

Parameters

ParameterType
options?SessionManagerOptions

Returns

SessionManager

Accessors

size

Get Signature

get size(): number

Get the number of active sessions

Returns

number

Methods

create()

create(options?): Promise<Session>

Create a new isolated session

Parameters

ParameterType
options?CreateSessionOptions

Returns

Promise<Session>


delete()

delete(sessionId): Promise<boolean>

Delete a session

Parameters

ParameterType
sessionIdstring

Returns

Promise<boolean>


destroy()

destroy(): Promise<void>

Destroy the session manager and clean up all resources

Returns

Promise<void>


findSessionByInteractionToken()

findSessionByInteractionToken(token): undefined | Session

Find a session containing an interaction with the given token Used by interaction callback endpoint to route responses to correct session

Parameters

ParameterType
tokenstring

Returns

undefined | Session


get()

get(sessionId): undefined | Session

Get a session by ID

Parameters

ParameterType
sessionIdstring

Returns

undefined | Session


getAll()

getAll(): Session[]

Get all active sessions

Returns

Session[]


getByToken()

getByToken(token): undefined | Session

Get a session by token (parses "mock:<session_id>" format)

Parameters

ParameterType
tokenstring

Returns

undefined | Session

On this page