Tuesday 7 February 2012

Magento BackEnd Login Issue

After the magento installation, I was not able to login into admin panel with the correct username and password.

For that I have gone to the file Varien.php in app/code/core/Mage/Core/Model/Session/Abstract/Varien.php

and found the code

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

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

Also We need to comment the following if statement. then only we can login to admin


/* if (!$cookieParams['httponly']) {
unset($cookieParams['httponly']);
if (!$cookieParams['secure']) {
unset($cookieParams['secure']);
if (!$cookieParams['domain']) {
unset($cookieParams['domain']);
}
}
}

if (isset($cookieParams['domain'])) {
$cookieParams['domain'] = $cookie->getDomain();
}*/



I was successfully logged in to the admin panel.

No comments:

Post a Comment