Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
scroll top