Is HTML5 localStorage safe in the long run?

I study HTML, Javascript, etc., and decided to create a small web application in the Chrome Web Store as an educational project. The application stores several bits of important data in localStorage (in fact, small saved text files), and I was wondering if this choice of implementation is too fragile. I know that the user will lose data if their hard drive dies or he manually deletes them, but is the data in danger under normal circumstances? For example, has Chrome ever decided to clean up localStorage for maintenance reasons?

Thanks Alex

+7
source share
2 answers

By default, Chrome deletes everything - including local storage - when you select "Clear browsing data", which some users may be able to do if they are asked to do something like the "empty browser cache" without understanding the consequences.

The HTML5 specification does not indicate anything regarding data security, possibly because it is a very young project. I would play in a safe place and save this data in the cloud - this is what your users expect.

+9
source

I would suggest handling local and session storage, like cookies. It is useful if it is there, but not vital, and you can continue without it (and possibly recreate it and save it again).

+4
source

All Articles