I have the following code on a usury login page:
public static function destruirSessao() {
if (isset($_SESSION)) {
session_start();
unset($_SESSION["codigo"]);
unset($_SESSION["nome"]);
session_destroy();
}
}
in the index.php page:
if (!thread::getUsuarioAtivo()) {
header("location: login.php");
} else {
?>
Código HTML/ conteúdo da página
<?php } ?>
Even setting the Session_destroy, it still remains, and then I am able to type the url: index.php and enter the last person session, how can I solve it? are there any logic errors in the code?
The Logout link is on the index page:
<a href="endSess.php?act=logout" ></a>
that calls another page that logs out, this logout page has the code
$verif = $_GET['act'];
if ($verif == "logout") {
thread::destruirSessao();
header('Location: login.php');
}