PHP Cookies works well on localhost, but it's not working on live server

后端 未结 6 1205
死守一世寂寞
死守一世寂寞 2021-01-21 20:25

Note: This issue is already solved, finally I found that it\'s not cookies problem, the problem is on unserialize() function. The serialized cookie which

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-21 20:52

    Probably your server time is not correct therefore Cookeis are not working on server.

    Try this:

    setcookie("settings", serialize($defaultSettings), 0);
    

    Setting expiration to zero will fix your issue in this case. or update your server time.

提交回复
热议问题