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 Reply

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


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>