Cant login to Magento admin panel in localhost using Chrome browser

Issue: You can’t login to the Magento admin panel on localhost using Google Chrome Browser.

This issue still happens in Magento CE 1.8, and below you will find the fix.

1. Find Varien.php

Edit /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

2. Find the code in Varien.php

Find the code around lines 87 through 94 (in Magento CE 1.8). It should look like the following:
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);

3. Comment out the code

Comment it out using the PHP comment tags of /* and */. Your new code should look like the following.

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

4. Save the file and login again

Save Varien.php and try logging in to the Magento admin panel again. This should fix any issues you have with using Chrome to login to your localhost installation of Magento.

1 Comment

  1. reaz uddin mahmood 07.23.17

    But the path /app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

    does not exist in my root folder. I have only ‘design’ and ‘etc’ folder under my ‘app’ folder.
    Any help would be very appreciated.


Leave a Response

* Name, Email, Comment are Required