Cookies in Remix

Поделиться
HTML-код
  • Опубликовано: 5 авг 2024
  • A cookie is a small piece of information that your server sends someone in a HTTP response that their browser will send back on subsequent requests. In this Single we explore how to create, write, and read cookies to manage user authentication.
    Explore the full code here 👉 github.com/remix-run/example-...
    00:00 - Overview
    00:39 - Scaffolding a createAccount function
    03:20 - Creating a cookie
    04:14 - Writing the cookie
    05:30 - Cookie attributes explained
    09:03 - Reading the cookie
    11:22 - Review
    Learn more at remix.run
  • НаукаНаука

Комментарии • 27

  • @texoport
    @texoport 7 месяцев назад +19

    I don't even use Remix on a day-to-day basis but it's always fun to catch Ryan's screencasts :)

  •  7 месяцев назад +5

    I loved your cookie explanations! You kept saying that it was maybe too detailed, but I loved every piece of it. As obvious as it might be for some devs, I'm a senior frontend dev and I had no idea. Just goes to show how much of web standards is hidden away from us nowadays.

  • @PGNCSGO
    @PGNCSGO 7 месяцев назад +8

    I have never used Remix, but I like to see the Web Standards in action (and Ryan is great teacher), so I love watching these videos anyways!

  • @user-wb2nn4fy4q
    @user-wb2nn4fy4q 6 месяцев назад +1

    Thank you so much for doing these Remix Singles, been so helpful seeing these things in RemixJS put to practice as I've been building my app 🙌

  • @emanuel_larini
    @emanuel_larini 7 месяцев назад

    Although it was not a part of the lesson I find super great that you explained the cookie details like samesite.
    Thank you! have a great end of year!

  • @theldentity
    @theldentity 7 месяцев назад +2

    have been using remix for a year now on two big projects and it has been truly amazing 🤩

  • @ahnmebnsina381
    @ahnmebnsina381 5 месяцев назад +1

    You explanation is far better than Kent. Trust me.

  • @Hariskhanmhariskhan
    @Hariskhanmhariskhan 7 месяцев назад

    good Ryan you went into them details too, people can always skip them, but good to see and understand everything you did

  • @SyedRiyadhulKarim
    @SyedRiyadhulKarim 7 месяцев назад

    Tutorials in remixrun are so helpful , clear and explained.. sometime some funny word make me laughing about typscript ... its mind refreshing. We love remix..

  • @Quenjii
    @Quenjii 7 месяцев назад +1

    I could listen to Ryan explain the web to me all day. Thankeg senpai

  • @julianjackson8756
    @julianjackson8756 7 месяцев назад

    I enjoy the extra details!

  • @CostGranda
    @CostGranda 3 месяца назад

    Thanks you for this series, really appreciated

  • @MaxPrilutskiy
    @MaxPrilutskiy 7 месяцев назад

    actually, samesite explanation was really useful, thx

  • @ginger-viking
    @ginger-viking 7 месяцев назад +1

    I could listen to Ryan talk about software development all day

    • @JEsterCW
      @JEsterCW 7 месяцев назад +1

      this^

  • @tech3425
    @tech3425 7 месяцев назад

    Loving remix

  • @ShawnFlahave
    @ShawnFlahave 6 месяцев назад

    Awesome videos Ryan. I'm in the future, btw. Still no jet packs.

  • @mrzachnugent
    @mrzachnugent 7 месяцев назад

    The future is good

  • @wb9283
    @wb9283 7 месяцев назад

    question, when the browser cookie (userId) send it to server to validate the user, do you not need to validate again if that userId actually exists or do a server check if that user authenticated via a auth table? or this mechanism is enough to confirm the user is valid?

    • @ReactTipsWithBrooks
      @ReactTipsWithBrooks 7 месяцев назад

      Good question! You definitely can do that. In my experience I usually need the userId as part of any queries that require authentication, so I don't bother looking up if the userId is valid, since the query itself will fail already

    • @wb9283
      @wb9283 7 месяцев назад

      @@ReactTipsWithBrooks how about just say querying data? let’s say data that doesn’t necessarily directly related to the userId. Do you still validate the user if they authenticated in the server or the active userId cookie is sufficient when request is sent?

    • @brookslybrand
      @brookslybrand 7 месяцев назад

      ​@@wb9283 I think it depends on your use case a bit. If the data isn't user specific but just requires an authenticated user there's no harm in just validating the user again (except for an extra db lookup, but if that shouldn't be very costly). However, since your server is the only thing that's able to set the value of this cookie it should be sufficient. So it's kind of up to you. Personally I would probably just validate every time in the example you gave, just to be super safe.

    • @wb9283
      @wb9283 7 месяцев назад +1

      @@brookslybrand awesome! thanks so much for the input! Really appreciate your time answering my query (no pun intended 🤣) but yeah, thank you and have a great year ahead!

  • @henrikrinne3639
    @henrikrinne3639 Месяц назад

    Hello from the future

  • @technikhil314
    @technikhil314 7 месяцев назад

    what vscode theme is it? also are you using vscodevim?

    • @texoport
      @texoport 7 месяцев назад

      Github Light

    • @GlazyDev
      @GlazyDev 7 месяцев назад +1

      On the theme, I'm not sure. He is using Vim emulation for VSCode though!