localStorage is no different than cookies from the perspective of privacy laws. https://softwareengineering.stackexchange.com/questions/2905...
The biggest advantage of localStorage is that it is, as its name implies, "local" to the site you are visiting. Cookies can be shared accross domains and sites you visit, but localStorage can not. If one on domain you store `localStorage.ID = 5`, you can not read that from another domain, as `localStorage.ID` will be undefined in a different domain context.
Seems to me like LocalStorage in this case is just a way to get around people deleting/blocking cookies. What would be the legitimate use?
> What would be the legitimate use?
Caching/storing GUI state and user configuration.
You (the server) doesn't need to know about LocalStorage contents. You can read and write from it via JS without ever sending that data somewhere. It actually improves privacy if done this way, because then the user owns the data and you just act upon it.
Unfortunately Apple thinks otherwise, they clear LocalStorage in Safari after a while by default.
Re:We ditched Google Analytics
by itsthisjustin on Monday June 01, 2020 @10:54AM
(#23379106)
Yeah we use this on our Chrome Extension Next Up to avoid sending data to our server. Keeps everything cached locally and lot less data in transit
See my comment above, localStorage can not be shared between domains as cookies can. So it's a lot better for privacy. With localStorage you can only track multiple visits of a user on the same site, not across sites.
Apparently Service Workers can also be used.
https://developers.google.com/analytics/devguides/collection...