Sunday 6 January 2013

Magento Error- Can’t Login to Admin Panel

Some times when you try to login your Magento Admin Panel after Magento Installation, nothing happens. That is to say you wouldn’t be able to login admin panel of your store.
magento admin cant login Magento Error  Can’t Login to Admin Panel
So today, we will be sharing solutions to such issue.
Reason of the problem
The main reason of such type of issue is that sometimes Magento fails to store cookies. Usually while working on localhost, people get such type of errors. We have cited following 2 solutions to this problem.

 Solutions

 Solution #1

If you are running Magento on local host using specific server applications like WAMP, XAMPP, AppServ etc.then try to replace “localhot” in your web url with 127.0.0.1.
For e.g.:
Replace
http://localhost/magento/index.php/admin
to
http://127.0.0.1/magento/index.php/admin
In case it doesn’t work for you, then follow the second solution mentioned below:

Solution #2

a)     Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.

b)    Find the code:

session_set_cookie_params(
 $this->getCookie()->getLifetime(),
 $this->getCookie()->getPath(),
 $this->getCookie()->getDomain(),
 $this->getCookie()->isSecure(),
 $this->getCookie()->getHttponly()
 );
 
and replace with

session_set_cookie_params(
 $this->getCookie()->getLifetime(),
 $this->getCookie()->getPath()
 //$this->getCookie()->getDomain(),
 //$this->getCookie()->isSecure(),
 //$this->getCookie()->getHttponly()
 );
 
c)     Save the file and try to login admin panel

1 comment:

  1. The option 1 work great on my side. I logout and login again using now the localhost url. It work great. Thanks buddy!

    ReplyDelete