I\'m having troubles logging into Magento\'s admin panel on one of our staging sites (it works 100% on our webdev servers and was working just fine not too long ago on the s
After doing all of that, And leaving all aforementioned solutions in place, still none of that worked for me. I run Win 7 + XAMPP and Magento Community magento-1.7.0.2
I could see the front-end, but no go on the login to the admin panel at all. All attempts were met with Invalid Username or Password, So I started messing with the Model files to debug, and finally changed
\app\code\core\Mage\Admin\Model\User.php line 340
From this :
if ($sensitive && $this->getId() && Mage::helper('core')->validateHash($password, $this->getPassword())) {
To this :
if ($sensitive && $this->getId() || Mage::helper('core')->validateHash($password, $this->getPassword())) {
Since it's a dev box, it will remain optional to validate password hashes I suppose
NOTE: Do not do this on a live environment, passwords will pass every time regardless to whether they are correct or not as long as your username is correct.
Essentially this code does the following if(username = correct or password = correct){LOG IN} - This means if it passes the username it will log them in.
I managed to fix it! I found this solution here: http://blog.chapagain.com.np/magento-admin-login-problem/.
I wanted to know why that fixed it though and var_dumped the items I commented out and realized that the cookie domain was being set to just '/' and we have magento set up under '/shop/'. So I went to the configuration section (having managed to log in after commenting out the 3 lines mentioned in the article), changed the Cookie Domain and Cookie Path to be blank and saved. I then uncommented those lines and tried again and all's working well!
I have found a new simple way to solve this issue. I have spent hours and at the end I have, maybe for desperation, this step: Request the Administration password.
So, go to the admin login page and click on the forgot password link.
Change the password, and now you can login again!
Regards
I had the same issue, and it was all with the localhost.
First i changed web/unsecure/base_url
and web/secure/base_url
. These both config values were having localhost and i replaced it by 127.0.0.1
. Still it was not working until i deleted all contents of two folders var/session/
and var/cache/
.
Now it is working fine.
go to Varien.php app\code\core\Mage\Core\Model\Session\Abstract\Varien.php cleanup the files of var folder and make the mentioned changes:
//session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath()
// 'domain' => $cookie->getConfigDomain(),
// 'secure' => $cookie->isSecure(),
// 'httponly' => $cookie->getHttponly()
);