So I'm trying to log in and log out of my website while restricting access to all parts of the site when logged out. Here is how I initialize my session:
session_name('my_session');
session_start();
session_save_path('/tmp');
I set some vars, and then I destroy my session:
session_name('my_session');
session_start();
session_destroy();
session_write_close();
unset($_SESSION['var1']);
unset($_SESSION['var2']);
I then proceed to run session_status() on a normal page on my website:
if (session_status() == PHP_SESSION_ACTIVE) {
die('A session is still active.');
}
And it does indeed die saying that there is still a session open.
Now, I could understand if I had some unnamed sessions floating around, but I've restarted Apache twice and deleted the sessions file in /tmp
. What else can I do to negate sessions?