Home » Magento

Login problem in Magento admin

[By: Kedar Sapkota | 11 July 2010 | 2,077 views | 7 Comments ]

The upgrade to version 1.2.1 was troubling as after the upgrade I had trouble logging into the admin page. After digging for hours trying to find a fix, I finally came up with the right fix!! View Entire Thread Here

The long and short of the fix is that apparently the newer Magento version is implementing some security check to make sure that the domain is a valid one that is accessing the admin page; a valid domain name or host consists of one with a period in the host name, so if you are installing locally using something like http://localhost, YOU WILL RUN INTO THIS PROBLEM! There are a couple ways to fix this

1) you can reference your admin page by using http://127.0.0.1 (this way it has periods in the host name) instead of localhost or

2) if you are on windows xp, add a host record in your hosts file by going to: C:\WINDOWS\system32\drivers\etc and have 127.0.0.1 point to something like magento.localhost

3. modify the core Magento code (keep in mind you may have to re-apply the fix if you update the code Magento code) ? go to: app/code/core/Mage/Core/Model/Session/Abstract and open up varien.php, and comment out lines 73 (comment out the comma at the end of the line) through 76 so that it looks like the following:

// set session cookie params
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath() //remove this after putting on server (leave the comma)   ,
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);
Share this nice post:

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.


2 + seven =