Re: SESSION values show up days later!
| From: | tedd | Date: | Sat, 28 Mar 2009 14:58:03 +0000 |
| Subject: | Re: SESSION values show up days later! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-290792@lists.php.net to get a copy of this message | ||
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: 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.commaryfran