UPDATED: Chrome & Safari Admin Panel Login Fix for Backend Bug

Submitted by metaharper - 5 years ago

I tried to be as keyword-centric as I could for this title. This has been a pervasive issue with Chrome and Magento for the past 3 years (possibly more). I have seen MANY fixes that claim to be better alternatives than this however this is the only consistent solution I have been able to find that works across versions and environments (i.e. local/production). You will need to edit app/code/core/Mage/Core/Model/Session/Abstract/Varien.php around line 88. The byproduct of modifying this core file: An error in your system.log. If you plan on making this permanent, be sure to create a module that overrides the core as opposed to editing it directly: http://inchoo.net/magento/overriding-magento-blocks-models-helpers-and-controllers/ UPDATE: This apparently also affects Safari.... http://magento.stackexchange.com/questions/49134/customers-couldnt-login-from-safari-in-magento-1-9

// File: app/code/core/Mage/Core/Model/Session/Abstract/Varien.php:~88

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

// After - just comment out the lines as demonstrated below
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
// 'domain' => $cookie->getConfigDomain(),
// 'secure' => $cookie->isSecure(),
// 'httponly' => $cookie->getHttponly()

<!-- Here are a few references showing solutions across versions and environments:

Stack Overflow: http://stackoverflow.com/questions/21159420/magento-admin-panel-not-login-using-chrome-but-working-fine-in-firefox

Magento Commerce: http://www.magentocommerce.com/wiki/how_to_fix_login_for_admin_on_local_install

Customer Paradigm: http://www.customerparadigm.com/easy-fix-for-chrome-magento-admin-login/
Learn PHP
comments powered by Disqus
Proudly hosted on Digital Ocean