I use some session variables. When I log out, the show_number function should write the number 0, but that is not the case.
logout.php:
<?php session_start(); session_destroy(); require_once('upper.php'); show_number();
index.php:
<?php $_SESSION['var'] = 1; echo "<a href="logout.php">Logout</a> ?>
upper.php:
function show_number() { // shows value of $_SESSION['var']; if (isset($_SESSION['var'])) echo "1"; else echo "0"; }
And the problem is that: When I click on the "Exit" link, the echo still writes number 1, and I need to reload the page to see the value 0.
Greetings
source share