Thanks for that reply and suggestion...maybe I am doing it wrong, but the original method seems to work more reliably for me:
If I use my original code:
session_start();
session_destroy(); // I think this is the trick!
session_start();
I can log in as one person, all the linked pages seem to work as appropriate for that person, I can then log out, and immediately log back in as someone else, and all pages seem to work fine for that person. Everything seems to work fine so far as I have tested it (it's a very complex site)
BUT if I replace that with the code taken directly from the manual:
// Initialize the session.
// If you are using session_name("something"), don't forget it now!
session_start();
// Unset all of the session variables.
$SESSION = array();
// If it's desired to kill the session, also delete the session cookie.
// Note: This will destroy the session, and not just the session data!
if (isset($COOKIE[session_name()])) {
setcookie(session_name(), '', time()-42000, '/');
}
// Finally, destroy the session.
session_destroy();
(....tried it both with and without adding session_start(); at the end here)
...logging out and logging back in as someone else does NOT work: even though I can log in as a different user, the subsequent pages that depend on a new set of session variable/values related to that new user do not work properly: it is as if the required session values do not exist at all for the new user.
If I am using a frames page, do the session functions have to be coded into it somehow?
<html>
<head>
<title>Team Page</title>
</head>
<frameset FRAMEBORDER="0" FRAMESPACING="0" cols="200,*">
<frame scrolling="auto" name="MENUBAR" target="self" src="Zmenu.php">
<frame scrolling="auto" name="CONTENT" target="self" src="home.php">
</frameset>
</html>