I am developing an Hybrid android app using HTML5 which will work completely offline.

Today morning when I opened the app, I saw that all the data stored in localStorage was cleared.

Under what scenarios can the localStorage get cleared?

Given these scenarios, is it a good idea to use localStorage?

  • 2
    "is it a good idea to use localStorage?" That depends on what you want to store there. You cannot expect it to be permanent, so design your application to take that into account. Commented Dec 11, 2013 at 15:47

1 Answer 1


This will look different/appear differently on browsers but with the example of Google Chrome, these are the different ways in which localStorage for your application can be erased:

1. Individually deleting localStorage keys in the Developer Tools menu: enter image description here

2. Clearing browser history/cache/cookies/etc. enter image description here

3. Un-installing the browser itself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.