Where does “localStorage” save data?

I have been taking a Javascript online course and we have been using “localStorage” to create a task list app. So I was wondering where does this actual data get stored because the data can be retrieved, edited and deleted so it must get saved somewhere. Since cookies aren’t being used I assumed the data was being saved in some text file somewhere locally on my computer. I did some searching online and found the answer to my question, which I thought I should share on the blog in case it can help someone else out there.

So first, there are two types of web storage, where data is stored locally in a user’s web browser. First, local storage, where the data stored has no expiration date and will persist after the web browser is closed. Second, session storage, where the data stored gets cleared after the web browser is closed.

So the data saved using web storage is stored locally on your computer. Each web browser has their own location to store this data. Looking at Wikipedia’s web storage page, it links to a few pages on StackOverflow (here and here) where others have listed the location of the saved data.

I also wanted to link out to the w3schools.com’s page on localStorage which has a quick simple example in Javascript showing how to set and retrieve data using localStorage.


Posted

in

by

Comments

Leave a Reply

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