NSessionStorageService allows you to cache data on the client. The data stored in this service gets cleared when the page session ends. A page session lasts for as long as the browser is open and survives over page reloads and restores. Opening a page in a new tab or window will cause a new session to be initiated.
Methods:
Syntax:
JavaScript |
sessionStorageCache -> {any} |
This method returns the data stored in session storage cache.
Return type: <any>
Syntax:
JavaScript |
getSessionStorage() -> {any} |
Returns:
Returns the data stored in the sessionStoragecache variable.
This method sets the value of key.
Property | Description |
---|---|
key | The key to be associated with the value. |
value | The value associated with the key |
Return type: void
Syntax:
JavaScript |
setValue(key: any, value: any) -> {} |
This method returns the value of the key from the sessionStorage cache.
Property | Description |
---|---|
key | The key to be associated with the value. |
Return type: any
Syntax:
JavaScript |
getValue(key: any) -> {any} |
Returns:
Returns the value associated with the key.
This method removes the key value from the session storage.
Return type: void
Syntax:
JavaScript |
remove(key: any) -> {} |
This method clears the data stored in sessionStorage.
Return type: void
Syntax:
JavaScript |
clearSessionStorage() -> {} |