why is php generating the same session ids everytime in test environment (WAMP)?

后端 未结 7 1352
礼貌的吻别
礼貌的吻别 2020-12-10 20:53

i\'ve configured wamp in my system, and am doing the development cum testing in this local environment. i was working on the logout functionality, and happened to notice tha

7条回答
  •  攒了一身酷
    2020-12-10 21:50

    session_destroy() destroys all of the data associated with the current session. It does not unset any of the global variables associated with the session, or unset the session cookie. To use the session variables again, session_start() has to be called.

    In order to kill the session altogether, like to log the user out, the session id must also be unset. If a cookie is used to propagate the session id (default behavior), then the session cookie must be deleted. setcookie() may be used for that.

    Taken from http://php.net/manual/en/function.session-destroy.php

提交回复
热议问题