PHPSESSID not being saved to cookie

前端 未结 3 2192
迷失自我
迷失自我 2021-01-05 23:41

the PHPSESSID variable that holds the session id is not being saved into the client cookie. This results in a new session id being generated every time I call the ses

3条回答
  •  星月不相逢
    2021-01-05 23:46

    The same thing happened to me, I couldn't log in to my users in Safari and Mac Os browsers, not even Firefox, only on Chrome (pc, not Mac). The reason turned out to be a combination, in php.ini, of

    1. session.cookie_lifetime=0
    2. session.cookie_domain=mydomain

    Where 0 I changed to 3600 (reasonable) as said by Shea and "mydomain" was (all my fault) wrong because it was missing the ".com", the right name of the domain!

    So I ended up changing the config to

    1. session.cookie_lifetime=3600
    2. session.cookie_domain=mydomain.com

提交回复
热议问题