Wednesday, June 3, 2015

can not login to magento after installation

Hi guys if you can not login to magento admin panel after installation it's not an issue. All what you need to do is you will have to modify up a file of magento.



Go to:
app\code\core\Mage\Core\Model\Session\Abstract\Varien.php

and look for this code.

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

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

you need to comment all of these codes. or you can replace this code with

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

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

After this modification open your admin URL

http://domain.com/index.php/admin

and now try login with the username and password that you have setup on the installation time.

Note: This is tested on magento ver1.9.x

0 comments:

Post a Comment