SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old August 4th, 2004, 11:14 AM
devey devey is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 9 devey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Red face Session Destroy for persistant shopping cart

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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Session Destroy for persistant shopping cart


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway