Hi all,

Having a bit of a strange problem and I'm not altogether sure whether it's
jQuery related or something to do with the awful, awful code it's part of,
but I thought I'd post up here to see if I could get some help figuring that
out J

 

I've got a webpage which has three cookies on it, cart_id, user_data and
user_other. Navigating around the pages and using the Firefox Web Developer
Toolbar shows these cookies are fine, one of each is set, and they're the
correct values. 

 

If, however, I submit an AJAX post request to add a product to the shopping
cart on this site, it doesn't work. Investigating the AJAX behind this shows
that two copies of every cookie named above is being sent - the first copies
have older and now incorrect data in them, and are followed by the CORRECT
data. Looks a bit like this:

 

cart_id=4a6b2bec89523599aa20a6ff7cc148f7; user_data=12%7C; user_other=1;
PHPSESSID=4c20e081a27ccba42a1f1009905f6f56

; session_id=a56c7977d215631d6f9eebadab534089; user_data=5%7C424235235;
user_other=0; cart_id=4e77b0

044b97d0ba322a4641ee2fcf6b

 

As you can see, cart_id, user_data and user_other are there twice. PHP is
evidently picking up the first copy of each cookie - the older, incorrect
ones - and using these. Meaning the products go into the wrong cart and I've
got myself a bit of a problem.

 

Has something like this ever happened to anyone else - and was it something
in your own code, or a weird jQuery glitch?

 

Because it will probably be relevant, we're talking about jQuery 1.2.6 here.

 

Regards,

Michael Price

Reply via email to