Guys, I have the following case:
To start session in PHP I do the following:
<?php
session_cache_limiter('private');
session_start();
and to close the session I do the following:
<?php
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['user']);
header("location: login.php");
exit;
}
The close session button I do it with a link to ?logout=1
But it happens to me that if I open the session with user A and leave that session and enter the session of user B the browser is loaded with data from < strong> user A and in fact shows me this data until I make an F5 in the browser and updates and loads the data of user B
There is a way in the few lines that I have presented to completely destroy the data (cookies, cache, etc etc) of the user of the previous session.