Magento Tutorials

Magento Admin Login Not Working Issue

Although you have entered the correct username and password, you still cannot access your Magento backend.


You are redirected to the same login page.

Nothing happened!

How to resolve this issue? Here are some tips which may help you.

Why You Can’t Login To Magento Administrator?

The reason might be that you’re accessing the Magento website through the hostname localhost. Magento checks whether the hostname is a real domain name, and if it isn’t, it fails to create the right cookies.

  • Under Linux or MacOS you could try using localhost.localdomain.
  • Under Windows you have to modify your hosts file for this. Easier is just to use the IP-address to access Magento.

Still Not Working? Here’s How to Fix Completely

If the solution above doesn’t work, follow the steps below:

  1. Go to app/code/core/Mage/Core/Model/Session/Abstract/Varien.php file within your magento directory.
  2. Find the code:







and replace it into this one:







  1. Save the file. And try to login to your admin again.

Hope this helps!

Further Reading:

Magento Maintenance Mode
Magento 2 “Invalid Form Key”


A knowledge craver who always strive to be wiser everyday.

Notify of

Inline Feedbacks
View all comments