I'm getting the infamous login loop in a fresh 1.9 install

The install is on a vagrant machine and it is accessed via the url: http://magento9.local locally.

I have cleared /var and cookies numerous times, reset all my permissions numerous times, its a clean install, theres no modules, i even tried the core file hacks (basically everything in this thread Magento 1.9 Can’t login to admin panel!)

I destroyed the instance and started again, and still can't get past the log in,

Home page works fine. n98-magerun

Magento was intsalled via

I am completely at a loss

  • Would I be correct therefore to assume, if you are using file based sessions, you have checked the disk is not at capacity or you are out of inodes (so sessions files can actually be created)? Commented Nov 11, 2014 at 17:29
  • @JonathanHussey session files are being created in var/sessions fine. So storage also isn't the issue
    – rogy
    Commented Nov 11, 2014 at 17:30
  • Ok thanks for the clarification. Have you tried the same fileset and database on another server instance (if practical)? Commented Nov 11, 2014 at 17:32
  • I will try that i guess, just a huge time sink aha!
    – rogy
    Commented Nov 11, 2014 at 17:53
  • Indeed, would just enable you to hopefully rule out some server configuration issue. Alternatively try running another Magento instance you know to be working elsewhere on the server instance you are having trouble logging in to and see if you then have the same issues. Commented Nov 11, 2014 at 17:56

1 Answer 1


Make sure you have specified a cookie domain name that is relative to your environment or the cookie cannot be set. admin->system->configuration->web->cookie domain You should also try and clear your browsers cache and cookies to ensure such as well. Some instances I've seen leaving the domain blank will work as well but most likely falls back to PHP internal functions to determine the domain to attempt to set when writing the cookie.

It appears there is an exception in Core as well during session handling that simply throws an empty exception in a condition of validation of the session.

Which may explain the redirect to the login afterwards with no indication of why.

You can validate this as well with viewing the cookies in the browser to determine if an adminhtml or frontend cookie is being set. As well as attempting to login to the customer side.

Also, as Alan mentioned in the linked article:

You're using the localhost as your server domain, and using a version of webkit that has trouble/bugs setting cookies for localhost in some situations.

domain.local may not be a valid TLD for your OS/Browser, Personally this is why I always map my local environments as simply local.domain.com to prevent any issues as such, as well as a lot of 3rd party modules validate domain names for licensing, this helps ease this problem as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.