While installing magento on xampp version 2.5 you have provided admin username and password. After installation finished you no longer login with your admin account. In fact in the "Log in to Admin Panel" window whenever you provide wrong password/username combination it displays "Invalid Username or Password." But whenever you provide correct password it does not show anything. Though a new url like
http://127.0.0.1/magento/index.php/admin/index/index/key/d135be4de664ab83db829120740e058a/
is displayed on the address bar.
Everytime you do this you can't log in to admin panel.
Cause of the problem
The problem occurs because magneto could not store cookies. We run it as localhost and localhost is not true domain but to store cookies we need a domain. That's why login stops without saying any word.
Solution of the problem
Way 1:
In different forums I saw they mentioned connecting as http://localhost/magento/index.php/admin will fail but if you connect as http://127.0.0.1/magento/index.php/admin it will work. But in my case IP address in the URL did not work too.
I made it work into whenever I changed my browser. Suppose I installed magento using google chrome browser and I open admin url into my firefox window and it worked. Though in the firefox the url http://localhost/magento/index.php/admin did not work, but url http://127.0.0.1/magento/index.php/admin worked fine.
Way 2:
-Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
-Find the code,
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath(),
$this->getCookie()->getDomain(),
$this->getCookie()->isSecure(),
$this->getCookie()->getHttponly()
);
-Replace above code by,
session_set_cookie_params(
$this->getCookie()->getLifetime(),
$this->getCookie()->getPath()
//$this->getCookie()->getDomain(),
//$this->getCookie()->isSecure(),
//$this->getCookie()->getHttponly()
);
-Save it and try to login to your magento admin panel.
It would work. :)
Related Documents
http://arjudba.blogspot.com/2009/04/magneto-installation-crashes-apache.html
Thank you Very much, for the information.
ReplyDeleteAwesome. After a long search at last I found this a workable solution.
ReplyDeleteThank you.
Its a simple but great work around. Thanks for the information. I have not gone into the code deep yet... so i have a concern. Will it expose any unforseen security loop hole into the system?
ReplyDeleteUseful post, thank you.
ReplyDeleteI had the same problem.
ReplyDeleteChanging the path in my browser from http://localhost to http://127.0.0.1
got me to log in.
Anybody an idea why this might happen?
Thank you very much! I tried to clear my cookies and accept cookies, but no results. Whit this great tutorial I solved my problem. Thank you very much!
ReplyDeleteThank you very much! This FINALLY fixed my problem after about 5 hours of frustration trying everything else and it wasn't working. Can't thank you enough.
ReplyDeleteYou sure are a lot of help! Thank You!
ReplyDeleteThis solution works fine...but is it a secure way to do this change...
ReplyDeleteI used second way - it works.
ReplyDeleteThank you!
Thank You
ReplyDeletethank you very much:-)
ReplyDeleteit doesn't work neither the way 1 nor the way 2
ReplyDeleteit doesn't work I continue to have the same problem
ReplyDeleteI tried to search that kind of code in my file located at - magento\app\code\core\Mage\Core\Model\Session\Abstract\Varien.php
ReplyDeletebut i find that my code in my file is something different that i found on in posts in various forms.
Mine is like this way -
// session cookie params
$cookieParams = array(
'lifetime' => $cookie->getLifetime(),
'path' => $cookie->getPath(),
'domain' => $cookie->getConfigDomain(),
'secure' => $cookie->isSecure(),
'httponly' => $cookie->getHttponly()
);
any one please tell me why mine is different than others and what kind of changes i can do to get the admin working.
Many thanks in advance
try changing your servername in your vhosts file as well as your hosts file. add a dot something to the end.
ReplyDeletesample hosts file entry:
127.0.0.1 magento.local
sample vhosts entry:
ServerName magento.local
...
with this you shouldn't need to preload the sample db.
I commented out these in 1.4.x:
ReplyDelete//'domain' => $cookie->getConfigDomain(),
//'secure' => $cookie->isSecure(),
//'httponly' => $cookie->getHttponly()
Thank you..........
ReplyDelete