Destroy PHP session on page leaving

前端 未结 7 1181
轻奢々
轻奢々 2020-12-06 02:52

I need to destroy a session when user leave from a particular page. I use session_destroy() on the end of the page but its not feasible for me because my page h

7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-06 02:55

    For a particular page you need to destroy the session, then unset the all session variable using

    unset($_SESSION['varname']);

    For the whole site you can use session_destroy();

提交回复
热议问题