I've read about this before in spots. (like the bug report system)

I've got a fairly high traffic server.  (30-50K uniques per day)

For the most part, everything works ok.  We get plenty of orders (between
70-90 a day).   However, I also get complaints from people who say they keep
losing their cart.

To try and track down what was going on.  I started storing some fairly
simple stats from the site.  Here is an example of one sent to me via e-mail
from my order.html page.

Person's cart failed?
Referring url is: http://www.t-shirtking.com/cart.php
User Agent is: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; DigExt;
Cookie output: c93856925c2ed796d3560d3729ebeb60
Other Session:
Other Session: addProduct
new session is: c93856925c2ed796d3560d3729ebeb60

A quick description is as follows.  If they come to the order.html page and
the script doesn't see the $_SESSION["cart"] variable, it sends me this
message.   It sends me the referring url. (a lot of people hit checkout
instead of add to cart for some odd reason, so this is proof that this
particular person went through the cart)  Then I grab the user agent to try
and narrow down the browsers with problems.  Then I see if the session id is
in a cookie.  Then, by looking at their session variable, I can see that
they went to cart.php via the given url.  (I store the http_refferer as a
session variable on the cart.php page)  Then, to prove to myself that the
cart function ran, I store the fact that the person came from the catalog
url and did indeed pass the cart command addProduct (via the form post
data).  As a last test, I send myself the session_id that order.html is
using (to make sure the session wasn't restarted)

So, what can I gather from this....I only give one example.  However, I get
about 10 of these messages a day.   I'm sure there are even more than that
considering that some people may give up when they notice their cart isn't
holding their products and don't bother going to order.html.  As you can
tell from above, it is clear that the session id is indeed intact.  Also,
I'm actually able to pull information out of the session that was stored on
a previous page.  (the addProduct command and the url stored in the session
by the cart.php page)  However, the cart variable, which is an object, is no
longer there.  (it is a simple object btw.  Just an object with an array in
it and a few member functions)

I thought perhaps using the default php session manager, that it was having
problems.  So I recently switched it to a mysql based manager.  (just using
the session_save_handler).  I still get the issue though. Therefore, I
cancel out blaming php's file storage method.

Where is my cart object going?  It happens only randomly.  It also happens
only to users of IE. (though 90% of our traffic are IE users)  It happens to
IE6.0, IE5.5, IE5.0.   It also happens at any time during the day (meaning,
high traffic times and low traffic times) I have also been able to
immediately look at my sessions table in the database when I receive a
message like the above.  Sure enough, the session is there...it has
data...just no cart.

Of course, the biggest bitch of all....I can't reproduce the bug to save my
life.  I've tested on 10 different machines using a variety of Windows
versions and IE versions.  I've tested the cart well over 100 times.  Yet, I
never seem to be able to break it.  I even try to add the product that I
know the person who did lose the cart was trying to buy.

I'm pretty sure I'm losing orders because of this.  I can't imagine how many
people are having issues.  I'm in desperate help as my client would love me
if I could fix the number of orders per day to get back to 100.  (he
switched to Miva a couple months ago and the dedicated Sun Solaris box
choked to death due to high server load.  around 50-60 according to top.)
So we came in and very quickly implemented a php based solution.  Of course,
it is working great except for this.

As a test, I just recently installed php4.3pre2 to see if it fixed the
issue.  alas, it did not.  I was previously using 4.2.3.



Josh Bauguss

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to