PHP SameSite session problem, session doesn't work

后端 未结 6 1663
醉梦人生
醉梦人生 2021-02-15 18:34

I hope anybody can give me some ideas to my problem. I am trying to apply SameSite cookie to make session work but it seems it doesn\'t work. The visited site html:



        
6条回答
  •  清酒与你
    2021-02-15 19:00

    Set session & cookies param php: https://www.php.net/manual/en/function.session-set-cookie-params.php Browser: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite

     "Strict"]); //none, lax, strict
    session_set_cookie_params(["Secure" => "true"]); //false, true
    session_set_cookie_params(["HttpOnly" => "true"]); //false, true
    session_start(); //everything before this
    

    OR php.ini:

    [Session]
    session.cookie_samesite = "Strict"
    session.cookie_secure = 1
    session.cookie_httponly = 1
    

提交回复
热议问题