Hi.
I have used this and it works fine.
I have 3 files login.php, menu.php and logout.php.
In the login.php file I set $verfied_user to the username and saves it using
session_register(\\"verified_user\\");
Directly after the user is redirected to my mainmanu using:
header(\\"Location: menu.php\\");
Okey so far so good.
First thing in the menu.php is the following:
<?php
session_start();
// Here is the check for authorization
if (!$verified_user) {
header(\\"Location: not_auth.php\\");
}
?>
The above is very important because this is actually the way you see that the session_destroy(); later on works.
In the menu.php I have a link called Logout. It calls logout.php. Logout.php looks like this:
<?php
session_start();
session_destroy();
?>
To verify manually type the URL to the menu.php and you will be redirected to a file called not_auth.php.