cookies vs localStorage vs sessionStorage – Beau teaches JavaScript




What’s the difference between cookies, local storage, and session storage? They are all ways to store data in a user’s browser but they each have different uses.

💻 Code: http://codepen.io/beaucarnes/pen/KmeRMx?editors=0011

🐦 Beau Carnes on Twitter: https://twitter.com/carnesbeau

⭐JavaScript Tutorials Playlists⭐
▶JavaScript Basics: https://www.youtube.com/playlist?list=PLWKjhJtqVAbk2qRZtWSzCIN38JC_NdhW5
▶Data Structures and Algorithms: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkso-IbgiiP48n-O-JQA9PJ
▶Design Patterns: https://www.youtube.com/playlist?list=PLWKjhJtqVAbnZtkAI3BqcYxKnfWn_C704
▶ES6: https://www.youtube.com/playlist?list=PLWKjhJtqVAbljtmmeS0c-CEl2LdE-eR_F
▶Clean Code: https://www.youtube.com/playlist?list=PLWKjhJtqVAbkK24EaPurzMq0-kw5U9pJh


We’re busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.

Join our community at https://freecodecamp.com
Read great tech articles at https://medium.freecodecamp.com

Original source


39 responses to “cookies vs localStorage vs sessionStorage – Beau teaches JavaScript”

  1. Great video… Thanks for sharing! Do you know of an approach to store values like these on a cloud bucket without using server side code like PHP? Sort of like a database but on a per user basis? Can it be done on javascript? Thanks

  2. dude don't just show the code. try to explain what and why for each, if possible. You are creating coders, when you could create software engineers. Don't just write ifs, think about why are writting that if.

  3. thank god ive finally found a coding yt channel that consistently makes sense and has high production quality. not only was the whole video really concise and helpful but i could actually hear ur fuckin voice and understand what the hell you were saying. and you sped the video up when you typed i was literally so relieved when i saw that shit i'm so pleased

  4. Are cookies really stored on the server too? I always thought they were stored locally, on the computer running the web browser. From what I read, there is another server-side storage type called "session", which is typically used in conjunction with the browser's cookies but not to be confused with browser cookies.

Leave a Reply