duandun3178 2017-02-22 07:30
浏览 53
已采纳

PHP会话cookie设置错误的路径或随机路径

I am setting a PHP session cookie in my application. On some requests to the page in question, the PHP session cookie path is \, but on other requests to the same page, it gets set to the path of the page \test\hello.

I need it to always be set to \.

Why would it randomly change? How to I force it to always be \?

  • 写回答

1条回答 默认 最新

  • dqeznd1697 2017-02-22 07:32
    关注

    Use session_set_cookie_params http://php.net/manual/en/function.session-set-cookie-params.php to change path to /

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?