Edit

Share via


SessionStorage class

Methods

containsKey(string)

Returns true or false if the given key is present in the cache.

getItem(string)

Get the item from the window storage object matching the given key.

getKeys()

Get all the keys from the window storage object as an iterable array of strings.

getUserData(string)

Getter for sensitive data that may contain PII.

initialize()

Async initializer

removeItem(string)

Removes the item in the window storage object matching the given key.

setItem(string, string)

Sets the item in the window storage object with the given key.

setUserData(string, string)

Setter for sensitive data that may contain PII.

Method Details

containsKey(string)

Returns true or false if the given key is present in the cache.

function containsKey(key: string): boolean

Parameters

key

string

Returns

boolean

getItem(string)

Get the item from the window storage object matching the given key.

function getItem(key: string): null | string

Parameters

key

string

Returns

null | string

getKeys()

Get all the keys from the window storage object as an iterable array of strings.

function getKeys(): string[]

Returns

string[]

getUserData(string)

Getter for sensitive data that may contain PII.

function getUserData(key: string): null | string

Parameters

key

string

Returns

null | string

initialize()

Async initializer

function initialize(): Promise<void>

Returns

Promise<void>

removeItem(string)

Removes the item in the window storage object matching the given key.

function removeItem(key: string)

Parameters

key

string

setItem(string, string)

Sets the item in the window storage object with the given key.

function setItem(key: string, value: string)

Parameters

key

string

value

string

setUserData(string, string)

Setter for sensitive data that may contain PII.

function setUserData(key: string, value: string): Promise<void>

Parameters

key

string

value

string

Returns

Promise<void>