Magento – Can not login Magento admin page after move to the localhost

adminbackendmagento

I just move my Magento store to my localhost environment for testing use, I also using Git to maintain code, but after I move all the files to my local environment, I can't login my admin page, but I can still see my frontend pages, and the git, the database, seems works well.

When I type a wrong admin/password to my admin page, it still gives me "Invalid password".
But when I enter the right one, it just refresh the page and stay at the login page, nothing happens.

Does anyone has met this problem before? Has any ideas?

Thanks in advance!

Best Answer

Although this question is old, all the above answers did not work for me until I did one additional thing.

Follow the very helpful answers already posted (summary):

  1. Change your base_url to http://127.0.0.1/ for secure and unsecure path.
  2. delete files in var/session and var/cache
  3. alter your Varien.php file accordingly - depending on your version of Magento.

And then:

  1. Finally, use http://127.0.0.1/your/site/folder/name/index.php/admin

It was the lack of the index.php/admin ( instead of using http://127.0.0.1/site/admin ).

I hope this helps someone else.