2

I upgraded from 1.8 to 1.9.1.

Add to cart goes to an 'empty cart'.

I ensured var (cache, session, session logs appear) was writable, refreshed cache and session (then same thing happens), cookie lifetime set to 86400, I tried cookie path '/' and cookie domain (various configs of mydomain.com, .mydomain.com). When I change these last cookie configs, I can add to cart and get to the onepage checkout, but on the billing information step it redirects back to an empty cart.

All settings in system->web->session validation settings set to no except Use SID on Frontend.

Also tried using db session storage instead of files.

When I enter date on the server it shows the correct BST time.

The cart page is http, the checkout https. All good when I run

n98-magerun.phar sys:check

What could be the problem?

Update

So after it went well again last night I have the same problem. I had just cloned the site and created a test environment, changed core_config_data, repointed app/etc/local.xml, flushed the cache and reindexed, and the site looks the same. I notice that before, when I could add to cart, there was the extra cookies in the console (PHPSESSID, BX, cfduid) but they're not there now. Also the frontend cookie changes between before the add to cart and after the add to cart. Now both sites show an empty cart after add to cart.

2
  • Can you use Firebug or Chrome Dev Tools to check which cookies are being submitted on the HTTP and HTTPS pages? Jul 5, 2015 at 19:27
  • Hello there, I've updated my answer with some of the cookie info, seems to be session/cookie related after all.
    – MW Millar
    Jul 6, 2015 at 10:52

2 Answers 2

2

I have faced the similar issue once on Magento 1.5 and fixed it by increasing the cookie life time to 86400 under

Sytem -> Configuration -> Web -> Session and Cookie Management


The Reason that I found out after doing some research on internet and different forum is that in Magento, by default cookie lifetime is set to 3600 (1 hour). But if the end users computer time runs ahead of server’s time, cookies will not get set for Magento frontend as well as backend. For example, end user’s computer time is 1 hour forward than server’s time, that means the cookie (holding user’s session id) will expire as soon as user logs in or tries to add an item.

1

After a lot of trial-and-error I just went back to a fresh install of 1.9.1 and the original db, and moved all the extensions and theme files over methodically. Permissions were the key - setting media and var folders to be writable especially, flushing cache and reindexing using n98.

I still get an error when trying to place the order in Firefox on Ubuntu ('Reference number already exists') that I have to resolve, but I was able to complete a purchase on Chrome and Safari on Ubuntu and IE and Firefox on Windows, so that's enough for now.

Update

Seemed to have solved it using hints from here. The culprit seems to have been a custom extension which was producing a 404 on the console, thus making the cookie drop.

1
  • 2
    That error is most likely from your payment provider, discarding an already used order ID. This happens when the session contains a "lastIncrementID" that is already used. Clear the session by deleting the frontend cookie and try again.
    – user4351
    Jul 5, 2015 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.