|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi, I have built the "persistant shopping cart" in the tutorial and it works fine.
I want to however destroy the session when the user "checks out" but seem to be getting totally lost with it. The session cookie is passed using function GetCartId() { // This function will generate an encrypted string and // will set it as a cookie using set_cookie. This will // also be used as the cookieId field in the cart table if(isset($_COOKIE["cartId"])) { return $_COOKIE["cartId"]; } else { // There is no cookie set. We will set the cookie // and return the value of the users session ID session_start(); setcookie("cartId", session_id()); return session_id(); } } which is stored in a file called db.php. The session is ended if they close the browser but i need to destroy it incase they don't as my orders table relies on unique cookie id's. Any help much appreciated edit - realise i have posted here instead of php forum, sorry Last edited by devey : August 4th, 2004 at 11:34 AM. Reason: Posted on wrong forum |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > Session Destroy for persistant shopping cart |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|