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

Method get

src/session.ts:325–327  ·  view source on GitHub ↗

* Gets the value of a key from the session datastore. * You can specify a default value to use when key does not exist or has undefined value. * * @param key - The key to retrieve * @param defaultValue - Default value to return if key doesn't exist * * @example * const username

(key: string, defaultValue?: any)

Source from the content-addressed store, hash-verified

323 * const preferences = session.get('user.preferences', {})
324 */
325 get(key: string, defaultValue?: any) {
326 return this.#getValuesStore('read').get(key, defaultValue)
327 }
328
329 /**
330 * Gets everything from the session store

Callers 15

initiateMethod · 0.95
getIntendedUrlMethod · 0.95
#resolveConfigMethod · 0.45
flashInputErrorsMethod · 0.45
#fetchSessionContentsMethod · 0.45
readMethod · 0.45
writeMethod · 0.45
readMethod · 0.45
taggedMethod · 0.45
writeMethod · 0.45
pluginFnFunction · 0.45
pluginFnFunction · 0.45

Calls 1

#getValuesStoreMethod · 0.95

Tested by

no test coverage detected