Created on 27 December 2018
icon_unfollowing
Login to follow
local-storage

Local Storage

Stable version 2.0.1 (Compatible with OutSystems 11)
Uploaded on 15 June 2020 by 
local-storage

Local Storage

Documentation
2.0.1

What is HTML Web Storage?


With web storage, web applications can store data locally within the user's browser.

Before HTML5, application data had to be stored in cookies, included in every server request. Web storage is more secure, and large amounts of data can be stored locally, without affecting website performance.

Unlike cookies, the storage limit is far larger (at least 5MB) and information is never transferred to the server.

Web storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.


Local Storage:

ActionDescription
CheckIsSetItemLocalStorageCheck if a item is set in local storage
ClearAllLocalStorageClear all items in local storage
GetItemLocalStorageGet item from local storage
RemoveItemLocalStorageRemove item from local storage
SetItemLocalStorageSet item to local storage


Session Storage:

ActionDescription
CheckIsSetItemSessionStorageCheck if a item is set in session storage
ClearAllSessionStorageClear all items in session storage
GetItemSessionStorageGet item from session storage
RemoveItemSessionStorageRemove item from session storage
SetItemSessionStorageSet item to session storage


Extra:

ActionDescription
CheckBrowserSupportCheck if browser support storage



How can I use the plugin?


Let's create an example to get my OneSignalAppId:

1º Step - I Recommend you to create a Structure to save your var names, for example:


2º Step - Create a local variable in your screen/action with that data type. In this case, we will create an action to get my OneSignalAppId:


3º Step - You only need to use the action "GetItemLocalStorage" to get the value:



How can I do the troubleshooting?


If you press F12 in your browser, you will have access to the Inspect Mode.

Navigate to "Application" tab and then you are able to check your variable "OneSignalAppId":


+info: https://www.w3schools.com/html/html5_webstorage.asp

Enjoy it!


Support options
This asset is not supported by OutSystems. You may use the discussion forums to leave suggestions or obtain best-effort support from the community, including from  who created this asset.
Dependencies
localstorage
LocalStorage
1.0.1
See all 1 dependencies