MCPcopy Create free account
hub / github.com/adonisjs/session / load

Method load

src/client.ts:127–136  ·  view source on GitHub ↗

* Loads session data from the session store * * @param sessionId - Optional session ID to load (defaults to current session) * * @example * const { values, flashMessages } = await client.load() * const data = await client.load('abc123') // Load specific session

(sessionId?: string)

Source from the content-addressed store, hash-verified

125 * const data = await client.load('abc123') // Load specific session
126 */
127 async load(sessionId?: string) {
128 const contents = await this.#store.read(sessionId || this.sessionId)
129 const store = new ValuesStore(contents)
130 const flashMessages = store.pull(this.flashKey, {})
131
132 return {
133 values: store.all(),
134 flashMessages,
135 }
136 }
137}

Callers 3

pluginFnFunction · 0.80
contextFunction · 0.80

Calls 3

pullMethod · 0.95
readMethod · 0.65
allMethod · 0.45

Tested by

no test coverage detected