Web Token vs. Cookie Authentication: Explained In 10 Minutes

Sdílet
Vložit
  • čas přidán 9. 07. 2024
  • Have you wondered what the difference is between using cookies and JWT's (web tokens) for user storage? Authentication? Let's draw it out! In this no code video, we look at the architecture of both systems and why you might choose web tokens over cookies. Be sure to subscribe and stay on top of developer topics!
    0:00 - Why Does This Video Exist?
    0:55 - How Cookies Work & Store Data
    3:06 - Cookie Disadvantage
    4:18 - An Alternative
    4:45 - Lot's Of HTTP Requests From Facebook...
    5:30 - How Web Tokens Work & Store Data
    8:23 - Recap
  • Věda a technologie

Komentáře • 6

  • @chrislyonm
    @chrislyonm Před 17 dny +1

    awesome explanation! another cool albeit less commonly needed difference with cookies is that because they are automatically sent by the browser, if you don't have control over the frontend but still need to authenticate users without storing their session on the server, they can be used to send encrypted tokens to have a hybrid solution.

    • @robertbunch-dev
      @robertbunch-dev  Před 15 dny

      Awesome point! This situation has plagued me before, and a hybrid solution is the only solution ;) Thank you for posting

  • @adoptedpotato4132
    @adoptedpotato4132 Před 19 dny

    Great video 🎉 thank you. Any chance you'll create a tutorial or guide on how to create an appointment booking system from scratch, could barely find any resources on it 😢

    • @robertbunch-dev
      @robertbunch-dev  Před 15 dny

      I will look into it! Hadn't considered it, but when it comes time for a full project, I'll see if I can use that.

  • @chetankumar9463
    @chetankumar9463 Před 20 dny +1

    Is OAuth different from these two?

    • @robertbunch-dev
      @robertbunch-dev  Před 20 dny +1

      Yes! OAuth is more of the process to get authenticated. It would replace the username/password part. Cookies/webtokens are used after OAuth is done to prove who oauth confirmed you are.