PHP Security: HttpOnly Cookies

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 20

  • @muhammadumarsotvoldiev8768
    @muhammadumarsotvoldiev8768 Před 7 měsíci

    Thank you very much!

  • @DavidAshby1
    @DavidAshby1 Před rokem

    Continuing on from this, how do you set the samesite attribute, strict, lax etc? Thanks

    • @DavidAshby1
      @DavidAshby1 Před rokem

      I think I have found the solution, everything appears to be correct
      setcookie('key2', 'value2', ['samesite' => 'Strict', 'secure' => true, 'httpOnly' => true]);
      With the above however I seem to be unable to put a lifespan on it as well as the path '/'

  • @WhiteSiroi
    @WhiteSiroi Před rokem

    thank you

  • @phillipscards
    @phillipscards Před 9 lety +2

    Thank you for another informative vid!

  • @chidioguejiofor
    @chidioguejiofor Před 4 lety

    Please, I have a question. I am trying to do something like this but realise that the cookie is constantly removed when I refresh the page.
    I had set the expiry date to a point in the future but it is still removed

  • @ambarishyt
    @ambarishyt Před 6 lety

    I think you are protect against csrf attack rather than xss

  • @taospencer1403
    @taospencer1403 Před 5 lety

    Have set HTTP to true, when i now write in the console document.cookie it has hidden the value i set for cookie, but irt still has two entry's which are: "_ga=GA1.2.1923171502.1558322790; _gid=GA1.2.189962841.1558322790" Do you know what these are. ?

  • @Actarsatan
    @Actarsatan Před 8 lety

    Im having a big problem, i just can`t unset or set o 1our ago the cookie, making impossible to delete the cookie.
    I searched in the php manual but nothing helped.

  • @scwfan08
    @scwfan08 Před 9 lety +1

    You should change your video description. The links are still phpacademy.org

    • @firepants20
      @firepants20 Před 9 lety +1

      +scwfan08 I'm sure he knows. It redirects to Codecourse anyways.

  • @RsRpHD
    @RsRpHD Před 9 lety

    I may sound stupid, but what is the point of doing this if you can see the cookie key and value in the developer tools?

    • @autowind
      @autowind Před 9 lety +3

      +Rasmus Rosengren
      Hi :) copy directly from php.net/manual/en/function.setcookie.php
      httponlyWhen TRUE the cookie will be made accessible only through the HTTP protocol. This means that the cookie won't be accessible by scripting languages, such as JavaScript. It has been suggested that this setting can effectively help to reduce identity theft through XSS attacks (although it is not supported by all browsers), but that claim is often disputed. Added in PHP 5.2.0. TRUE or FALSE

    • @NoahNobody
      @NoahNobody Před 9 lety

      +Andrew Ng Thanks, I guess it's silly to have cookies not needed by JS to be readable by JS. I wonder how the mechanism is to keep them private works though.

  • @lifeforce3451
    @lifeforce3451 Před 5 lety

    many thanks sir

  • @raymonddeloso62
    @raymonddeloso62 Před 9 lety

    where is the generating pdf video? :)

  • @bFix
    @bFix Před 9 lety

    Does this include https atleast? If not then it's not safer!

    • @bFix
      @bFix Před 9 lety

      ah ok so there is a second flag for that, good to know
      or will it always be sent over https and that flag only ensures then, that it will only be sent encrypted (over https)?

    • @bFix
      @bFix Před 9 lety

      ok good to know, thx!