Skip to content

Set and get values with localStorage

HTML 5’s localStorage allows to store values, but can, other than cookies, storage large amounts of data and is more secure. To interact with it, there are two critical methods that are needed to interact with it:

Please note that localStorage stores it values as string and that you need to convert your data to strings. See the following posts for how to do that:
JSON object to string
JSON string to object

[sc name=”src” url=”https://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage” ]

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.