I'm not sure what you mean by the session is still active, but if you mean that the variables still are set to the same values, try moving the session_unregister after the session_unset, but still before the session_destroy. Janet
----- Original Message ----- From: "Lee P Reilly" <[EMAIL PROTECTED]> To: "PHP List" <[EMAIL PROTECTED]> Sent: Wednesday, January 16, 2002 8:58 AM Subject: [PHP] Newbie: Ending Sessions > Hi, > > I wonder if someone could tell me what I am doing wrong with the > following? I am trying to end a session (logout), but am having a > problem... > > > I register a new session as follows: > > authenticate.php (snippet) > ---------------------------- > // if the user has just tried to login > if ($username && $password) > { > // if the user is present in the database, register the username in > the session > if (login($username, $password)==1) > { > $valid_user=$username; > session_register("valid_user"); > } > } > ---------------------------- > ^ This works okay. BTW, session_start() is present - just not shown > above. I then have a hyperlink to a logout function: > > > logout.php (snippet) > ---------------------------- > session_start(); > include("sasdap_fns.php"); > $result = session_unregister("valid_user"); > session_unset(); > session_destroy(); > ---------------------------- > ^ $result always returns "1", but when I return to /reload /refresh the > login screen I see that I am still logged in i.e. the session is still > active. > > Can anyone see a problem anywhere? Thanks very much in advance. > > - Best regards, > > Lee > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]