JavaScript Cookies vs Local Storage vs Session Storage

Поділитися
Вставка
  • Опубліковано 11 січ 2019
  • The ability to quickly store information on a user's browser is an incredibly under used, powerful feature of JavaScript, and this is partially because of how unwieldy it used to be. In this video I am going to discuss the differences between cookies, local storage, and session storage, and how dealing with browser storage has become much easier since the initial release of cookies. I will also talk about how to use cookies, local storage, and session storage to store information in a users browser.
    Cookies vs Local Storage vs Session Storage Article:
    blog.webdevsimplified.com/202...
    Twitter:
    / devsimplified
    GitHub:
    github.com/WebDevSimplified
    CodePen:
    codepen.io/WebDevSimplified
    #LocalStorage #Cookies #SessionStorage

КОМЕНТАРІ • 460

  • @oldbootz
    @oldbootz 4 роки тому +520

    and on the eve of the year 10000 there was the great cookie expiration crisis...

    • @dawid_dahl
      @dawid_dahl 4 роки тому +62

      oldbootz I’m here from the future to warn all you guys that you shouldn’t be setting your cookies to expire in the year 9999. Please. Human civilization depends on it.

    • @reveluv8851
      @reveluv8851 4 роки тому +3

      @@gl3nda96 set it to 1 ad

    • @nedaltrebor8553
      @nedaltrebor8553 3 роки тому +7

      @@gl3nda96 couldn't you set it programmatic. Like, get current year > add 2

    • @barbelljoe
      @barbelljoe 3 роки тому +14

      @@dawid_dahl shit I will have to find my password to login again.

    • @Ginfio
      @Ginfio 3 роки тому +3

      What kind cookies? Chocolate chip.. cookies..? Or
      Ok nvm.

  • @EduardKaresli
    @EduardKaresli 5 років тому +371

    Man, you're as good as The Net Ninja, which is my current source of information. I hope you'll get many subscribers soon, your style is clear, short and to the point.
    Thanks!

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +110

      Thank you! That is a huge compliment. The Net Ninja has amazing content and was one of the sources of inspiration for my channel.

    • @dangerdoctor920
      @dangerdoctor920 2 роки тому +4

      Same I only watch net ninja and kyle

    • @shaikhasad2911
      @shaikhasad2911 Рік тому +1

      Brad Traversy aka TraversyMedia, Shaun aka Net Ninja and Kyle aka WebDevSimplified, these guys are gold for webdevelopers especially for beginners!

    • @101kawsar
      @101kawsar Рік тому +1

      Three years later, they have same amount of subscribers.
      Congrats Kyle 🤞

    • @tigana
      @tigana 2 дні тому

      Yes! Him and Net ninja are so gifted at explaining

  • @Jhonny610
    @Jhonny610 2 роки тому +149

    0:00 Overview
    4:56 LocalStorage
    8:10 SessionStorage
    9:43 Cookies

  • @bohdanromanovich4912
    @bohdanromanovich4912 2 роки тому +19

    This is simply the best UA-cam channel to quickly get to the bottom of a particular issue that you have without long explanations of things you don't need. For everything else, there is documentation. You help a lot of people, thank you so much!

  • @BoLeee
    @BoLeee 3 роки тому +18

    Yo! Thanks for breaking down topics like this, many youtube searches lead to you and i'm never dissapointed. Thank you

  • @pastorfred2543
    @pastorfred2543 4 роки тому +55

    Today is my first time of seeing JS cookies and session storage.. I learnt local storage through MDN some time past.. Thanks Sir, I pray your Channel grows rapidly.

    • @WebDevSimplified
      @WebDevSimplified  4 роки тому +4

      Thank you! I'm glad my video was insightful for you.

    • @sumanthchippagiri1687
      @sumanthchippagiri1687 3 роки тому

      @@WebDevSimplified Hi bro.Your content is awesome and the way you simplifies is above that.I have some real doubts. I can explain in detail if you provide me your mail id.

  • @nehakumar9889
    @nehakumar9889 3 роки тому

    Crisp and clear explanation. Sir I have an interview tomorrow for an internship. I am watching this to revise the concepts and I chose the correct channel for this purpose. Amazingly explained and straight to the point.

  • @fabiajero
    @fabiajero 3 роки тому +73

    It would be great also if you explain the different situations you may use each of them and which security problems you could have, like for example, storing user session data (auth).
    Great video. Thanks

  • @_briantravis
    @_briantravis Рік тому

    Your videos on JS are simply the best. Explain exactly what you need to know, nothing more and nothing less, in the most efficient way. Thank you so much!

  • @alanhunt3772
    @alanhunt3772 4 роки тому

    This is fantastic, I've been scratching my head a lot lately trying to differentiate session, storage, and cookies and then lining it up with session on the server side. I've started looking at how other websites do it through the browser dev tools and cookies seem to be the weapon of choice.

  • @steves1015
    @steves1015 4 роки тому +1

    You have a very clear and concise way of approaching the subject. I felt like I learned quite a lot in 15 minutes! Thank you!
    I hope you get many more views on your videos.

  • @ridl27
    @ridl27 4 роки тому +6

    Bro, You have a talent to share knowledge with us! So easy to follow and understand. You will have much more subscribers in the future for sure! Its all about of time =)

  • @19jewels95
    @19jewels95 4 роки тому

    Amazing. Clear, concise, straight to the point and beginner-friendly examples. You provide the perfect platform for beginners like me, and I'm always grateful :)

  • @harshilparmar9076
    @harshilparmar9076 5 років тому +35

    bro... thanks for putting much effort..this channel is awesome!!

    • @WebDevSimplified
      @WebDevSimplified  5 років тому +10

      Thanks! I love making these videos so it doesn't even feel like work. Well at least most of the time :P

    • @jeromelanteri6469
      @jeromelanteri6469 3 роки тому

      @@WebDevSimplified even if you do not copy what is existing already (and that is exactly the same) ?

  • @karlomoonblade
    @karlomoonblade 4 роки тому

    keep the very detailed straight to point explanation , i really can understand the topic without watching several times

  • @horrorbreakdown
    @horrorbreakdown 4 роки тому +15

    Great channel, I've learned a lot. You're very clear and to the point.

  • @Sam-xv5ko
    @Sam-xv5ko 4 роки тому +1

    I was searching here and there to learn these things and you really simplified them. Thank you, man, you saved my day. Subscribed

  • @NITESHSINGHNRS
    @NITESHSINGHNRS 4 роки тому +1

    Every day I am learning from your channel...great work ..

  • @quicksilvuhh
    @quicksilvuhh 4 роки тому +1

    You're great at explaining things. I'm very grateful!

  • @erykczajkowski8226
    @erykczajkowski8226 2 роки тому +5

    Great explanation of the differences! I think it would be useful if you provided some info on the security concerns and proposed some actual libraries for cookies management.

  • @shawnyiwerd
    @shawnyiwerd Рік тому

    Tack för att du delar med dig. Jag har använt Morelogin nyligen och det skyddar integriteten.

  • @giordanovaldez8348
    @giordanovaldez8348 4 роки тому

    Liked and subscribed. Great explanation for everything. Keep up the good work!

  • @WilsonGalter
    @WilsonGalter 4 роки тому +1

    Dude, I had to learn about session storage today on the go in order to create a user login in system!
    I wish I had seen this video before that!

  • @rohitkudalkar92
    @rohitkudalkar92 4 роки тому +1

    Thank you sir. This is what I was searching for. Thanks bro all your unique videos with best example. Love and support ❤️

  • @TimothySmithii
    @TimothySmithii 3 роки тому +41

    Best cookie video I've seen. You can tell this guy has a deep knowledge of the material with the way he effortlessly explains all the moving pieces.
    I know this is written with for Devs, but it's also a really good sort of introductory deep-dive into cookies. He did a great job of explaining the different types of cookies, how to identify them, what they do, and the reasons for why they are needed. Most concise yet jam packed with info video on any subject I've seen recently. Surprised to find it on the subject of web cookies, as in my experience it has been difficult to find videos that aren't either too shallow or too deep in their scope. This was perfect and I feel like I can take the next step without any huge gaps in my understanding now.
    Great job, thank you!

    • @CJFX_
      @CJFX_ 2 роки тому

      When you know what you're talking about you can put it in simple terms 😆

    • @jellegalgenbeld7226
      @jellegalgenbeld7226 2 роки тому

      lastName=Smith

    • @DenzelHooke
      @DenzelHooke 2 роки тому

      @@CJFX_ Sometimes yes, sometimes no

    • @ojasdighe991
      @ojasdighe991 Рік тому

      @@DenzelHooke precise

    • @youvegotmail9385
      @youvegotmail9385 Рік тому

      He's the man. Crazy knowledgeable.

  • @Alireza-kw6fj
    @Alireza-kw6fj Рік тому

    missed your voice for about 6 month after you full javascript course, I'm happy to hear you again ;)

  • @kj6372
    @kj6372 3 роки тому

    Thank you so much for uploading such a simple and easy to understand tutorial video

  • @giorgieliozashvili633
    @giorgieliozashvili633 Рік тому

    Hey Kyle! Thanks. basically, you taught me React and these little things in javascript. Thank you. You're a huge time saver

  • @kagisohadebe9913
    @kagisohadebe9913 4 роки тому

    my first web dev video and it was hella helpful thanks for it , liked & subscribed looking forward to more content

  • @erikstone8336
    @erikstone8336 2 роки тому

    First: nice.
    Second: thank you, I’ve been trying to understand cookies vs session storage and which to use and when, your video cleared up a lot!
    Thanks again

  • @bdk9830
    @bdk9830 3 роки тому +1

    The best lecture of cookies and storages in the world. thanks Kyle !

  • @master_ofnone
    @master_ofnone 2 роки тому

    This was a great video! Detailed yet concise. Defs subscribing :)

  • @sruthisoman6533
    @sruthisoman6533 4 роки тому

    Excellent presentation. This helped me understand the concept so much better. Thank you✌️

  • @SubhobrotoRoy
    @SubhobrotoRoy 5 років тому +4

    Thank you for making such an informative video!!!

  • @user-lq1mm2tn5v
    @user-lq1mm2tn5v Рік тому

    Many thanks for such clear and structured explanation!

  • @ekaterinaastrid2636
    @ekaterinaastrid2636 3 роки тому +4

    I really love u, man! this is the best channel about coding.

  • @farshadgh2011
    @farshadgh2011 3 роки тому +1

    Great tutorial, thanks.
    It's crazy how express-session uses cookies for server-side.

  • @devanshishah9481
    @devanshishah9481 2 роки тому

    Nicely explained. Thank you for passing the knowledge!!

  • @raybagss
    @raybagss 3 роки тому +1

    Thank you so much. This really explained everything really well.

  • @jayreyes828
    @jayreyes828 2 роки тому

    My goodness you are covering all the necessary topics, my friend

  • @jayteecollins1279
    @jayteecollins1279 5 місяців тому

    Your explanation is always on point! Good job!

  • @faithyintii8457
    @faithyintii8457 4 роки тому

    Thanks man... it was quick, straight to the point and informative... i am grateful.
    you just earned a new sub... :)

  • @lucaspedro6488
    @lucaspedro6488 3 роки тому +1

    Thank you very much for the explanation. Very helpful content. Keep it up!!

  • @happyv6872
    @happyv6872 4 роки тому +8

    Man, what a beautiful set of eyes! Your voice is also very nice to listen to. You deserve more subs and views.

  • @BORIS_NEKEZOV
    @BORIS_NEKEZOV 3 роки тому +1

    Thank you for that good explanation, Kyle!

  • @AnvarAzizovMusic
    @AnvarAzizovMusic 4 роки тому

    Thank you for the detailed explanation.

  • @anikdas5218
    @anikdas5218 2 роки тому +3

    Why I love his videos! Because his contents is to the point. No extra shit.

  • @langsonchibili1329
    @langsonchibili1329 4 роки тому

    THERE IS A REASON WHY *I'VE SUBSCRIBED* TO THIS GUYS CHANNEL, HE'S SO HUMBLE, AND VERY INTELLIGENT AT GETTING THE CONCEPTS IN ONE'S HEAD, AND HE'S SO KNOWLEDGE-PACKED. I AM A FAN AND A STUDENT OF YOURS NOW. MR.

  • @user-oy4kf5wr8l
    @user-oy4kf5wr8l 4 роки тому +1

    Thank you man, simple and clear

  • @underwater2003
    @underwater2003 2 роки тому

    First working tutorial i found in half of year! Thanks!

  • @jevessonsouza7947
    @jevessonsouza7947 Рік тому

    2 words: Thank You!
    Your videos have been help me a lot!!!

  • @doylemcteller1335
    @doylemcteller1335 4 роки тому +1

    Dude, you‘re always on point. Thanks a lot.

  • @jagdishshetty4782
    @jagdishshetty4782 4 роки тому +3

    Really useful !!! Thx so much !!! Keeping making more videos !!!

  • @steven5712
    @steven5712 3 роки тому

    Thanks, man. You are awesome. I was just wondering how Redux persist works and this video came up in my recommendation. Great stuff!

  • @TaskSwitcherify
    @TaskSwitcherify Рік тому +3

    Great video. FYI: 10 MB and 5 MB means MEGABYTES, which is 8x larger than megabits.

  • @rahulbhatia1313
    @rahulbhatia1313 4 роки тому +1

    I did not knew Jordi el niño also had a web development youtube channel. great work, keep it!

  • @govinda399
    @govinda399 2 роки тому

    you are my favourite content creator. I watch alot of your videos nowadays.

  • @gregruiz921
    @gregruiz921 2 роки тому

    Great overview Kyle... appreciate how you showed everything real time with code and the dev tools. Thanks!

  • @user-jm9rh4ef2z
    @user-jm9rh4ef2z 2 роки тому

    Thanks Kyle! you explained it very clearly !!!

  • @official.mhm13
    @official.mhm13 4 роки тому

    this video really helped me understand... thank you

  • @breebw
    @breebw 3 роки тому +11

    3:31 mid 2020, Apple(iOS and desktop Safari, is implementing a new localstorage rule. Its a game changer.
    "Specifically, Safari will erase IndexedDB, LocalStorage, Media keys,
    SessionStorage, and Service Worker registrations after seven days if the
    user does not interact with the associated website during this period."

  • @smurffronda2951
    @smurffronda2951 2 роки тому

    thanks man, have a great week

  • @riznimohamed
    @riznimohamed 2 роки тому

    Best explanation. I learned what I exactly need to know

  • @salmalakhlifi1901
    @salmalakhlifi1901 3 роки тому

    Very good explanation thank you.

  • @youvegotmail9385
    @youvegotmail9385 Рік тому

    Opening chart was super helpful .

  • @arnobislam1615
    @arnobislam1615 Рік тому

    amazing and simplest explanation

  • @azimmalpekar9072
    @azimmalpekar9072 2 роки тому +1

    Very good explanation, to the point.

  • @pallad1461
    @pallad1461 Рік тому

    Best tutorials about web developing on UA-cam

  • @adonsav
    @adonsav 10 місяців тому

    Thanks for your videos! Great work 🙏

  • @swibay
    @swibay 4 роки тому +1

    You inspire me a lot dude! Tanzania🇹🇿

  • @ghazanfarabbas4187
    @ghazanfarabbas4187 2 роки тому

    Thank for such valuable tutorial.

  • @siamesedev3646
    @siamesedev3646 4 роки тому +1

    Thanks Jordi! You're the man!

  • @a_maxed_out_handle_of_30_chars
    @a_maxed_out_handle_of_30_chars 11 місяців тому +2

    thank you, simple and to the point :)

  • @mehtabahmed6092
    @mehtabahmed6092 3 роки тому

    Thank you so much for the nice explanation

  • @ca7986
    @ca7986 2 роки тому

    What an amazing explaination! you are amazing dude!

  •  2 роки тому

    thank you so much. make me clearly about the concept of them.

  • @iqbalkhatridr
    @iqbalkhatridr 2 роки тому

    Excellent and simple video.

  • @eduardogil1775
    @eduardogil1775 2 роки тому

    Great explanation, thnx x sharing 👍🏼

  • @avvinashjha
    @avvinashjha 3 роки тому

    These videos are good please share more ...🙏

  • @SepSol75
    @SepSol75 3 роки тому

    As always fantastic explanation

  • @sachinbonde89
    @sachinbonde89 2 роки тому

    Really nicely explain

  • @piriyaie
    @piriyaie 2 роки тому

    Thank you for this great video.

  • @webeingmarketingteam5881
    @webeingmarketingteam5881 Рік тому

    Thanks, that was super useful! 🙏

  • @samahgad241
    @samahgad241 Рік тому

    Thanks,it is very helpful.💐

  • @samcodes2912
    @samcodes2912 3 роки тому

    short explanation and clear as water 👍

  • @SzTz100
    @SzTz100 4 роки тому

    Excellent introduction

  • @michalkrajewski7092
    @michalkrajewski7092 5 місяців тому

    You did it, thanks, that's the explanation I was looking for, Regards

  • @BryanGranseDevs
    @BryanGranseDevs Рік тому

    Great video thanks 👍

  • @ticossauro
    @ticossauro 3 роки тому

    Great content! Thank you!

  • @rishengopaldass1103
    @rishengopaldass1103 3 роки тому

    Amazing video. Thank you.

  • @_wekesar_6639
    @_wekesar_6639 3 роки тому

    Web dev has never been simpler.. Thanks wds 😌

  • @JoeDebono
    @JoeDebono 3 роки тому +1

    - Thanks buddy, if only I had watched this video when I was learning to bake cookies! Local Storage is what I actually needed then but didn't know it. Your commentary is crisp and clear as is your visual display style. I'm a teacher by trade so I recognise a good communicator when I see one. Thank you sincerely.

  • @ZazaMasta
    @ZazaMasta 3 роки тому +10

    This guy has done everything I need, he is a walking institution !

  • @faycalhamici2092
    @faycalhamici2092 3 роки тому

    short, interesting and very useful Thanks

  • @elserby7417
    @elserby7417 Рік тому

    Thanks, you helped me a lot

  • @frontend3409
    @frontend3409 Рік тому

    That table at the beginning is helpful. You could show however how (or when) cookies are sent to the server. As i checked in developer tools, they're sent before first call to the webpage

  • @andrew.schaeffer4032
    @andrew.schaeffer4032 Рік тому

    Great video thanks!

  • @Koenv3
    @Koenv3 4 роки тому +17

    Nice video! The size of localstorage and sessionstorage in the video is in megabytes not megabits.

  • @mosiurrahman4061
    @mosiurrahman4061 3 місяці тому

    Clean Lecture.

  • @user-pf7xe7fm2p
    @user-pf7xe7fm2p Рік тому

    thank you very informative video