CSRF Protection in Laravel

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • In this video, I'm going to explain how Cross-site request forgery happens and how Laravel helps you protect your application from it.

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

  • @sir_brian_d
    @sir_brian_d 4 года назад +1

    You explain things so well. You're a great teacher

    • @themsaid
      @themsaid  4 года назад

      Thanks! Glad you found it useful :)

  • @MuhammadMohsen
    @MuhammadMohsen 4 года назад +1

    Audio is fine now, Good job dude.

  • @joshmountain
    @joshmountain 4 года назад +1

    Thanks Mohamed! Very straightforward and easy to understand. The only thing I believe was left out was when and how CSRF tokens are rerolled - is a new token generated and stored in the session for each request?

    • @themsaid
      @themsaid  4 года назад +4

      The CSRF token is rolled whenever the session is rolled. So if you have the session lifetime set to 2 hours (the default) and the user stayed idle for 2 hours, the token will expire on his next request and he'll need to refresh to get the new token.

  • @hambaku7318
    @hambaku7318 4 года назад

    Thanks for video, very helpful!

  • @mikeziri
    @mikeziri 4 года назад +1

    nice sound!
    good explaining ;)

    • @themsaid
      @themsaid  4 года назад

      Glad you liked it :)

  • @izzudinanuar7867
    @izzudinanuar7867 4 года назад

    That really helpful

  • @lianglaw6923
    @lianglaw6923 4 года назад

    Yeah, thanks for your contribution. Mohammed.

  • @dinhquochan
    @dinhquochan 4 года назад

    It's better. Congrats!

  • @alexios4392
    @alexios4392 4 года назад

    :) so with Laravel Sanctum can we use both - CSRF-Token from meta tag and XSRF-Token from cookies? Does it matter?

  • @a7medsayed2010
    @a7medsayed2010 4 года назад

    i think that you mentioned before that cookies are encrypted then how axios extracts csrf token from them ?

    • @themsaid
      @themsaid  4 года назад +1

      axios send the encrypted CSRF token, Laravel decrypts it before verification.

    • @a7medsayed2010
      @a7medsayed2010 4 года назад

      Many thanks keep going

  • @YunusIs
    @YunusIs 4 года назад

    Audio is much better on this video.

    • @themsaid
      @themsaid  4 года назад

      Thanks for the feedback :)