How come my logout page is not clearing the session variable for all pages?
I do not have security assist, so how do I make it so that my logout.php page clears the session variable on all of my restricted pages. As it is right now, all i have to do is login, and if I hit the logout button, I can still access the restricted pages by adding the url. The restriction is set correctly, its just that the session variable is not being cleared.
<?php require_once('Connections/localhost.php'); ?>
<?php require_once('webassist/mysqli/rsobj.php'); ?>
<?php require_once('webassist/mysqli/authentication.php'); ?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$LogOut = new WA_MySQLi_Auth();
$LogOut->Action = "logout";
$LogOut->Name = "user";
$LogOut->execute();
}
?>
<?php
$logOut = new WA_MySQLi_RS("logOut",$localhost,1);
$logOut->setQuery("SELECT * FROM users WHERE UserName = ?");
$logOut->bindParam("s", "".(isset($_SESSION['UserName'])?$_SESSION['UserName']:"") ."", "-1"); //colname
$logOut->execute();
?>