Magento – successful admin login redirects to login page

admindatabasemagento-1.7

I've imported a copy of the live db to my new dev site using sequel pro. I've had to use this tool as the db has some errors in (duplicate SKU's) and we're trying to fix them, but not on the live server!

I'm not sure what the issue is, but the symptoms are as follows.

http://sitename:8888/admin for the admin login. fill out the username and password. hit login. and it redirects me straight back to the login page.

If I intentionally get the password wrong, it gives me the red error box. So I know I'm geting the password right, because there is no error box. However the admin section doesn't load. Is there an admin setting somewhere in the config stored in the db that I need to reset?.

Best Answer

This is a very well documented issue - Ashley Schroder put together a great compilation of the well-known issues with admin login problems:

http://www.aschroder.com/2009/05/fixing-magento-login-problem-after-a-fresh-installation/

This is the most common solution, if you have set up Magento to run locally (on MAMP for example) then you may be accessing the Apache webserver using the localhost hostname. A security setting in browsers means that the cookie will not be set, though apparently in FF3 at least, this behavior is a bug?.

So simply stop using localhost, you can use your localhost interface (e.g. 127.0.0.1 or 127.0.1.1). To determine your localhost interface you can look at the contents of your hosts file:

In your case it looks as if you need a "." in the domain name. Some example domains that will work are local.dev, magento.local, 127.0.0.1 - again, anything with a "." in it.

Related Topic