Jump to content

Strange session problem


pabtyf

Recommended Posts

Hi,

 

I'm having some major issues with sessions on a shopping web site. (Unfortunately I didn't code the whole thing, only the page with the error on:( ).

 

The problem occurs when a user has been through the site and made a purchase, shopping bag info is stored in mysql using the session IDs as the cart ID. After the user goes through the checkout (HSBC integrated) and confirmation emails have been sent out, I have the following code:

 

session_regenerate_id();


unset($_SESSION['cart_id']);
unset($_SESSION['voucher_value']);
unset($_SESSION['voucher_code']); 

 

which should reset the session ID but retain all the session data (right?). When I go through the site everything works as it should, tested in IE6 and 7, Firefox and Opera.

 

The owner of the site goes through the same process, and when they go to place a second order, the contents of the cart are still there and the new order overwrites the previous order. For some reason for her the session ID is not regenerating.

 

I've tested this locally on Xampp, and remotely on the live site but I cant reproduce the problem, (I wondered if it was due to the page being within https instead of http as the rest of the site is but it works for me.)

 

Any help or advice appreciated, I've run out of ideas now...

 

Thanks

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/104827-strange-session-problem/
Share on other sites

Sounds like they're caching it somehow, maybe the cookie isn't getting cleared properly? I've had problems in the past trying to clear session variables. maybe you should try to seed the session id regeneration somehow? On a side note are you testing to verify that the new session ID doesn't already exist in the database?

On a side note are you testing to verify that the new session ID doesn't already exist in the database?

 

No I'm not checking it against the database, at least I don't think it is I didn't code the rest of the site. But I'm definately not doing it on this page. I can't understand how it is only causing problems with her (and it would have to be the owner of the site!!) :-[

I am using session_start(). I've found the problem now..

The problem was in the user not the code!. She was running both orders at the same time in 2 tabs in IE. That was why I couldn't replicate it! ::) (pretty sure that is not normal shopper behaviour)

 

Thanks for your suggestions anyway  :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.