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

Method put

src/session.ts:285–287  ·  view source on GitHub ↗

* Puts a key-value pair to the session data store * * @param key - The key to store the value under * @param value - The value to store * * @example * session.put('username', 'john') * session.put('user.preferences', { theme: 'dark' })

(key: string, value: AllowedSessionValues)

Source from the content-addressed store, hash-verified

283 * session.put('user.preferences', { theme: 'dark' })
284 */
285 put(key: string, value: AllowedSessionValues) {
286 this.#getValuesStore('write').set(key, value)
287 }
288
289 /**
290 * Checks if a key exists inside the datastore

Callers 8

setIntendedUrlMethod · 0.95
commitMethod · 0.95
requestHandlerFunction · 0.95
session.spec.tsFile · 0.80
api_client.spec.tsFile · 0.80

Calls 2

#getValuesStoreMethod · 0.95
setMethod · 0.80

Tested by 1

requestHandlerFunction · 0.76