i have this file
secure.php
session_start();
if(empty($_SESSION[\'u_name\'])) {
header(\"Location:emprego.php\");
}
if(isset($_GET[\'logout\'])) {
All the other solutions didn't seem to work for me. However, this workaround did the trick. Basically, the code below keeps calling the logout until the logout finally succeeds:
if (isset($_GET["logout"])){
if (isset($_SESSION["username"])) {
unset($_SESSION["username"]);
session_destroy();
header("Location:/?logout=true");
exit;
}
header("Location:/");
exit;
}