Any tips on using localStorage?

Modified on Fri, 11 Nov, 2016 at 4:25 PM

All HTML assets share the same localStorage. So, when setting values with setItem, add a prefix to them with asset name or any unique identifier, so changing values in one asset won’t affect others. Similar applies for deleting with e.g. localStorage.clear(), this will delete local storage for ALL HTML assets. Be careful!


Also localStorage is persistent even when asset is updated or removed. Please keep in mind that local storage has limited size (~2.5MB).

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article