There are three types of storage:
Local: Data in local storage never expires, even if a site visitor closes a page. When the visitor reopens the page later, the data can still be retrieved. You can store up to 50kb of data in local storage.
Session: Data in session storage is available while a site visitor's web session is active. The session ends when a visitor closes the browser tab or window. When the session ends, all the data in session storage is lost. Reloading or restoring the page doesn't affect session storage data. You can store up to 50kb of data in session storage.
Memory: Data in memory storage is available as long a site visitor doesn't refresh or close the page. Reloading or restoring the page clears the memory storage data. You can store up to 1mb of data in memory storage.
Get hands-on experience with the Frontend Storage API on the Hello Storage example page.
To use the Frontend Storage API, import the needed storage types from the
wix-storage-frontend
module:
The APIs in wix-storage-frontend
can only be used in frontend code.
Some older browsers may not fully support wix-storage-frontend
. See Browser compatibility
for more information.
Learn more about wix-storage-frontend in Getting Started and on Wix Learn.