This is wrong, IMO.
The author states the main risk to LS data is an XSS vulnerability in the website. While true, an XSS in a website is pretty much a "game over" and allows the attacker to get any information and perform any action in the context of the site.
Essentially, if a website has an XSS your information is compromised no matter what mechanism the site uses to store it.
That’s exactly what I was thinking also. Local storage is protected by the origin access policy. If that is compromised by XSS, it doesn’t matter how or where the data is stored; it’s accessible.
I agree. The only reason I can think to justify this is that the author is implying you only should use the HttpOnly flag for security reasons. Still seems odd that they don’t know you can set cookies with JS.
OMG, he tell us to not store anything security-critical in Local Storage but advice to store encrypted session in Cookies instead!
He says that any JS code on the page can access Local Storage but he doesn't mention that Cookies can be accessed by JS as well as Local Storage. And also, Cookies will be sent with each request event if request target is an image or a CSS, when with Local Storage you can decide which data should be sent with each individual request.
He says that Local Storage can store strings only, but he doesn't tell that Cookies is even worse than this - it's JUST ONE string at all.
After that he tells about Cookie-related CSRF attacks prevention which not needed with Local Storage.
"Please Stop Using Local Storage" is not helpful and will confuse people who are unfamiliar with browser storage. I'm guessing the author meant, "Please Stop Storing Application Data in the Browser Instead of a Server-Side Persistence Layer (DB)". Local Storage is a specific thing in the browser and is useful in specific cases.
I believe all of the author's stated shortcomings of local storage apply to all browser storage options.
* String Only
* Synchronous
* No Web Worker Support
* Size Limits (smaller for cookies but all have limits)
* Any JavaScript code on the page has access (don't include scripts you don't trust)
Also, keep in mind...
* There is no guarantee the browser will encrypt the content on disk. I believe chrome encrypts cookies, but I'm don't think others do. I don't believe local storage is encrypted at all. Session storage & session cookies should only be in memory. You shouldn't be storing PII in the browser anyway.
Well, localstorage is still much better than cookies. Browser includes cookies on all requests to your server. There is no way javascript can tell browser to stop that!!! Now, stop using cookies!!!!
Essentially, if a website has an XSS your information is compromised no matter what mechanism the site uses to store it.