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

后端 未结 6 1206
死守一世寂寞
死守一世寂寞 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 21:02

    Try this:

    setcookie("settings", serialize($defaultSettings), time()+3600*24*30, '/'); // added path
    

    Also, could it be that serialize($defaultSettings) result is too large?

提交回复
热议问题