session is not destroyed

前端 未结 5 613
醉梦人生
醉梦人生 2021-01-27 06:55

i have this file

secure.php

session_start();
if(empty($_SESSION[\'u_name\'])) {
    header(\"Location:emprego.php\");
}

if(isset($_GET[\'logout\'])) {
         


        
5条回答
  •  被撕碎了的回忆
    2021-01-27 07:36

    I recently found header_remove(); http://php.net/manual/en/function.header-remove.php

        Caution: This function will remove all headers set by PHP, including cookies, session and the X-Powered-By headers.
    

    Not sure whether this is the appropriate way to do it, but it's pretty effective for log out functionality.

提交回复
热议问题