Recently I have started learning Magento. It’s just amazing. I have faced one interesting problem today with Magento.
The problem is, I have just installed magento on my machine, after installation front end work fine, but I can not login to the magento admin panel even with correct username and password. It not even given error for this but redirecting to the same page. And if I enter wrong username and password it will give Wrong username / password error. It seems like that you have proper credential but magento just not allowing you to let into the admin panel.
I was wondered that magento is a very big community and it’s a very fast growing shopping cart open source code, it must not have this type of bug.
There are several solutions for these, but I will post here which is most works for most of developers.
If you have installed you magento on localhost and trying to access like http://localhost/magento .
But due to standard restriction browser don’t save cookies for domains with no dots in domain name. So I suggest you to access your magento using http://127.0.0.1/magento, this will work. This works even for me.
For this solution, if you have installed your magento using localhost, then you have to make some alteration in database tables.
You have to replace localhost with 127.0.0.1 in core_config_data table.
User below query to find the rows which have localhost entered:
You will get two rows, you just have to update these two rows from localhost to 127.0.0.1.
You can use below query to update these two rows:
I hope you will place proper values in above queries suitable for you.
If you are on windows machine then you can change you host file to locate localhost to some other domain which have at least single dot (.) in it.
You can find the this file at below path:
In this folder there must one file called hosts, in this file you can point localhost or 127.0.0.1 to some domain like http://www.localmagento.com
Hope this post will helpful for you, waiting for your responses.
Avinash Zala currently working at a leading web development company as a Sr. PHP Web Developer. He is the founder of the Xpert Developer. He has completed B.E. in Information Technology. Born and brought up in Ahmedabad. He loves to code and coding is all about passion for him. Follow him on twitter at Avinash Zala & Xpert Developer.
View all posts by: Avinash