PHP session reseting shopping cart contents
Posted: Mon Sep 24, 2007 1:13 pm
Problem:
I have a site with a cart. I track the contents of the cart in a database, and use a cookie on the clients computer with a session ID in it to keep track of the shopper as they shop. On occasion, after adding a few things to the cart, the cart mysteriously empties.
Notes:
I have a site with a cart. I track the contents of the cart in a database, and use a cookie on the clients computer with a session ID in it to keep track of the shopper as they shop. On occasion, after adding a few things to the cart, the cart mysteriously empties.
Notes:
- Running PHP 5.2.3 & MySql 4.1.22 on FreeBSD 6
It does not appear to be product specific.
In some cases, I might only add 10 products to the cart before the problem occurs, and in other cases I am able to add 200.
I have watched the headers from my browser to make sure they are correct.
This occurs with Firefox and IE, so I don't think it's browser specific.
I can see that the database table which contains the cart contents, that it is emptying whenever the problem occurs.
The session ID is correct and consistent everywhere (e.g. browser, database)
I have a function which empties the cart (used for "empty" cart button), but I don't believe that is getting called cause there's normally an associated message which prints out with it (e.g. "You have emptied your shopping cart").
With 100+ thousand lines of code, I can solve most problems, so my skills are okay in troubleshooting, however I am stumped on this one
I am not the programmer, please speak slowly and clearly.