Cookies have been with us for a long time (Internet Explorer v2 had support for them in October 1995). There’s nothing wrong with them, and they certainly made the web a more pleasant place, but after nearly 25 years a lot has changed. Local Storage (you’ll find it under Web Storage on W3) is and isn’t a replacement for cookies. That’s what’s most confusing about it. In most cases, you can safely use localStorage instead of cookies and get the (wrong) impression that they are the same, while they are not. Read on to see a no-nonsense breakdown of how and when to use localStorage to replace cookies.
Revolution or evolution?
Local storage, or localStorage, or DOM storage or web storage (I’m not making these names up; all of them are in use, and all reference the same thing) got real-world adoption among popular browsers in 2012 as an “HTML5 feature”. It seemed like a godsend replacement for cookies. A fix for bloated requests carrying unneeded data all the time and size limitations. While it does “solve” those problems, it’s not an apples-for-apples replacement for cookies.
As the name implies, the data is stored locally,
Source: https://managewp.org/articles/17787/localstorage-vs-sessionstorage-vs-cookies-a-detailed-comparison
source https://williechiu40.wordpress.com/2018/08/27/localstorage-vs-sessionstorage-vs-cookies-a-detailed-comparison/
No comments:
Post a Comment