note 18841 added to function.session-destroy
| From: | alex at adobepro dot com | Date: | Thu, 07 Feb 2002 05:56:06 +0000 |
| Subject: | note 18841 added to function.session-destroy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26329@lists.php.net to get a copy of this message | ||
Case Problem: Session Cookie Persistance.
Case Scenario: After a user submits their order, and come back to view their cart, bang, the same
items are there again! I don't want the user to close their browser or the session to expire
after any given specified time to clear the cookie.
Case Target: destroy the session cookie after a person checked out with their shopping cart.
Case Solution: use this code after your shopping cart has been submitted:
setcookie(session_name(),"","","/");
Comments: Only took a darn hour or so after compiling everyone's ideas on it, but no one had
the magic bullet! Keep in mind, this creates a whole new session! So unless you drop another cookie
on their page in addition to the phpsession one, they will have to log back in to get their profile
up. Hope this helps people in a similar situation!
--
http://www.php.net/manual/en/function.session-destroy.php
http://master.php.net/manage/user-notes.php?action=edit+18841
http://master.php.net/manage/user-notes.php?action=delete+18841
http://master.php.net/manage/user-notes.php?action=reject+18841