Fixing the Chrome cookie problem in Magento

After having this problem several times as I installed, and re-installed Magento, I decided to post this on my own blog for future reference.
Sometimes when using Magento with a Chrome browser the cookie functionality doesn’t work, the code modification is relatively simple.
Open the app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file and find the following code, somewhere near line 78:

$cookieParams = array(
//             'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
//             'domain'   => $cookie->getConfigDomain(),
//             'secure'   => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly()
        );

Notice the three commented out lines. That is the minimum necessary to get cookies working with Chrome. You could also just comment out the whole section, as that will work as well.
That’s all there is to it. Enjoy!

Leave a comment

Your email address will not be published. Required fields are marked *

Close Bitnami banner
Bitnami