Solved: Magento admin login only refreshes, no login with Chrome

When accessing Magento backend via yoursite.com/admin, one might accidentally not be able to log in using Chrome browser. I had this issue occur many times and finally I got tired switching to Firefox for logins and investigated. 

Seems that the problem comes from cookies - Magento has more than one cookie and doesn't know which one to use, hence the refresh in Chrome. When deleting the cookie for your Magento site you are able to log in to admin in Chrome. But you don't want to do that every time. 

How to delete the cookie for a specific site in Chrome? 

1. Right click anywhere on the site and select "Inspect element"

2. Select Resources at the top, then click the arrow before Cookies on the left hand side top reveal cookies for the site

3. Right click on the cookie and select Clear, this deletes the cookie. 

You should be able to log in now to admin, try.

 

How to solve the admin login problem permanently?

Make use of Magento's settings to define your cookie domains. 

1. System > Config > Web > Session Cookie Management

2. Set your cookie domain to .yourwebsite.com (this will not work if your development site is at devsite.yourwebsite.com etc)

3. Clear browser cookie for your site (as explained before)

4. Clear sesson data from your site (FTP var/sessions)

Set the cookie domain for all of your sites, clear cookies and sessions and the admin login problem should be gone. 

 

Apart from all the problems with it, I still love Magento

About me

Iinstructor of robotics (LEGO Mindstorms), computer teacher, IT support, web dev, currently studying cyber-physical systems engineering.

If you found a solution here, would you consider donating $25,000 for my next project?

Just kidding, 1$ would do fine.

Hope you found what you needed. Thanks for stepping by.