Local Storage vs Cookies (for auth tokens) | token in cookie or local storage
![Local Storage vs Cookies (for auth tokens)](https://i.imgur.com/axBPWDg.jpg)
Hieverybody!IhavebeeninterestedinthewholeLocalStoragevsCookiesdebateforawhilenow,startingfromwhenIgotcommentsaboutthisonmyJWTexplanationvideo[1]post.LocalStorageisbetterIdidquiteabitofresearchonthisawhileagoandcametotheconclusionthatLocalStorageisbetterthancookiesforstoringanytypeofauthenticationtoken(oratleast,justassecure).HoweverImovedontootherthingsanddidntreallytalkaboutitwithanyoneormakeaposttodiscussitwiththecommunity.Thisistheaimofthispost.IbelievethatLocalStorageisbetterthancookies-...
![Local Storage vs Cookies (for auth tokens)](http://pix4.agoda.net/hotelimages/agoda-homes/5899847/61e1a790eeb181e40e8f262ea5a396dc.jpg?s=800x)
Hi everybody!
I have been interested in the whole Local Storage vs Cookies debate for a while now, starting from when I got comments about this on my JWT explanation video[1] post.
Local Storage is better
I did quite a bit of research on this a while ago and came to the conclusion that Local Storage is better than cookies for storing any type of authentication token (or at least, just as secure).
However I moved onto other things and didnt really talk about it with anyone or make a post to discuss it with the community.
This is the aim of this post. I believe that Local Storage is better than cookies - but I could be wrong, so I really want to have an educated discussion about this :)
Why?
This is my reasoning for why I believe Local Storage is better.
取得本站獨家住宿推薦 15%OFF 訂房優惠
本站住宿推薦 20%OFF 訂房優惠,親子優惠,住宿折扣,限時回饋,平日促銷
重要的基礎:Cookie v.s Session Storage v.s Local Storage And ... | token in cookie or local storage
淺談Authentication 下集:如何更安全地使用Token | token in cookie or local storage
Where to Store JWTs | token in cookie or local storage
Do I have to store tokens in cookies or localstorage or session ... | token in cookie or local storage
Should JWT be stored in localStorage or cookie? | token in cookie or local storage
JWT LocalStorage vs Cookie | token in cookie or local storage
Local Storage vs Cookies (for auth tokens) | token in cookie or local storage
Storing Authentication Tokens | token in cookie or local storage
Store Tokens | token in cookie or local storage
Do I have to store tokens in cookies or localstorage ... | token in cookie or local storage
Token 放localStorage?sessionStorage?還是Cookie? | token in cookie or local storage
Local Storage vs Cookies | token in cookie or local storage
Store JWT in cookie or localstorage ? | token in cookie or local storage
the best | token in cookie or local storage
LocalStorage vs. Cookies | token in cookie or local storage
Using Cookies vs Local Storage for storing access tokens | token in cookie or local storage
LocalStorage vs Cookies | token in cookie or local storage
The Best Place for Your JWTs | token in cookie or local storage
Exploring Token Storage | token in cookie or local storage
![](https://i.imgur.com/axBPWDg.jpg)