Pages on my php site need to be refreshed all the time. For example I have a timetable for each user that's different and if I login and view the timetable and logout, then when I login as a different user and view that timetable it will show the previous persons timetable, unless I refresh it. There are many more pages on my site that have this issue. Do I need to do something extra on logout? I know I can user ctrl+f5 but i want the site to be able to manage things for me. Has anyone else has a similar issue to this Any suggestions?
Here's my logout code:
<?php
//include 'header.php';
session_start();
include 'dbconnect.php';
//set the session date in to an empty array
$_SESSION = array();
//Expire thier cookie files
if (isset($_COOKIE["user"]) && isset($_COOKIE["pass"]))
{
setcookie("user", '', strtotime( '-10 days'), '/');
setcookie("pass", '', strtotime( '-10 days'), '/');
session_destroy();
}
//destroy the session variables
session_destroy();
//double check if the user exists
if (isset($_SESSION['username']))
{
header("Location: message.php?msg=Error:_Logout_Failed");
} else {
session_destroy();
header("Location: index.php");
exit();
}
session_destroy();
?>