How do I kill a PHP session?

后端 未结 2 1804
渐次进展
渐次进展 2020-12-12 01:22

I am writing a social networking site, and I am trying to figure out PHP sessions. At the top of the login page, I call session_destroy(), and I call session_start() at the

2条回答
  •  执念已碎
    2020-12-12 01:45

    Use session_destroy to destroy the session data and session_unset to clear the $_SESSION variable respectively.

    Furthermore, call session_regenerate_id(true) after an authentication attempt to change the current session’s ID and destroy the session data that is still associated to the old session ID.

提交回复
热议问题