Tuesday, April 24, 2012

can not login into magento admin Panel

I have installed magento 1.6.2.After installing fresh magento,I could not login in to admin panel of magento.It is even not throwing any exception message.Although Password and username are correct,I am not able to login in magento admin panel.After providing correct username and password,it only generates a new URL ,something like:


http://localhost/magento/index.php/admin/index/index/key/f1585bj4de664ab83db50940e058a/


Solution:
\magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php


change line no 84 to 87


from:
 // session cookie params
        $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath(),
            'domain'   => $cookie->getConfigDomain(),
            'secure'   => $cookie->isSecure(),
            'httponly' => $cookie->getHttponly()
        );
to:
 // session cookie params
        $cookieParams = array(
            'lifetime' => $cookie->getLifetime(),
            'path'     => $cookie->getPath()
            // 'domain'   => $cookie->getConfigDomain(),
            // 'secure'   => $cookie->isSecure(),
            // 'httponly' => $cookie->getHttponly()
        );
Reason:
Magento do not store cookies.We run it on localhost which is actually not a true real domain But to store cookies we generally need a domain.Becasue of that we can not login  and even not getting any exception or error message.

No comments:

Post a Comment

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method... magento 2

Fatal error: Class Zend\Stdlib\Parameters contains 1 abstract method and must therefore be declared abstract or implement the remaining met...