At 2:39 PM -0700 3/27/09, Mary Anderson wrote:
Hi all,
I use session variables to store values from one page to another on my website. Alas, sometimes, but not always, the values persist from one invocation of the script to another! Just how, exactly, do I make them go away when a user exits the program? I assume my users will not always be logging out explicitly.
   Thanks.
    maryfran



maryfran:

I don't know if this will help, but this a "solution" I used once.

<?php session_start();

// destroy all session data including login -- the user can login again to make sure everything is OK

// bye bye cookie
if (isset($_COOKIE[session_name()]))
   {
   setcookie(session_name(), '', time()-42000, '/');
   }

 // and finally
session_destroy();

header("location:http://<where I wanted to send the user>");
exit();
?>

Cheers,

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to