|
XCart Items not staying in shopping cart - customer sessions lost |
|
|
|
|
Written by Administrator
|
|
Thursday, 12 February 2009 |
|
I recently set up a test site in a subdirectory of a site that was running a live xcart in the main web root directory. I copied all the files, changed the config to point to the new directory and DB. Everything seemed to work fine until we started testing the checkout and realized no cart items were staying in the cart. You could log into the admin area just fine and stay logged in, but the customer side was just losing all the sessions using the x-cart session handling method (method 3). Session method 2 (mysql sessions) was throwing a storage initialization error. Session method 1 was not an option. I tried everything I could think of including scouring these forums and was resigned to setting up a local test copy to run in a debugger when I decided to ask Emerson at EWD Hosting if he had any idea what could be causing it. He suggested changing the session name from xid to something else on the test store. Sure enough, it worked. I have no idea how the live store's sessions were interfering with the test store, except that possibly by being in a subdirectory, some of those include statements that include the "top.php" file are written to recurse to higher level directories and I'm wondering if the test copy is recursing up to the main live xcart directory and including the wrong config or session files. Otherwise I don't see how the live cart can be affecting the test copy. The moral of this story -- it is wise to change your session names for each test copy of x-cart that you are running. I changed mine to xid2 and it fixed the problem.
|