Login fails due to loop on localhost. Any ideas why? I have git cloned a site and used Backup and Migrate to bring the database over the the local host.

Working on the remote host the login works fine. Not locally. Well not anymore it worked for about an hour I'd say.


  Firefox has detected that the server is redirecting the request for this address in a way that will never complete.


I've cleared all history, tried different browsers, and restarted apache a few times.

Any ideas?

EDIT:

I can install it and after installation I stay logged in for about 60 seconds after migrating the database. I'm then redirected in a loop.

The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

This problem can sometimes be caused by disabling or refusing to accept
cookies.


I've cleared the browsers cookies and cache
I've cleared drupals cache
restarted apache
tried different browsers


I'm beginning to think it may have something to do with how I'm setting up the site. I'm doing it in a very round-about way I think.


backup database from dev site
git clone site and point httpd.conf and hosts file at it
create database with same name, user and password from settings.php file
install site
go in an enable backup and migrate
import database from backup


site loads. drops after 60 seconds or so with the firefox message from above. I'm not 100% sure where to start troubleshooting.
You could find out for sure by adding some logging code in drupal_goto() to backtrace what function fired the redirect. Then inspect why that function fired the redirect and work back from there.

Or, some more "guesswork" approaches -


Check you don't have $base_url set in settings.php.
Clear your cache tables after installing to copy (or don't back up the cache table contents).


drush cc all


Disable modules which might be confused by relocation - securepages, canonical_url, logintoboggan (guessing here). 


drush dis securepages canonical_url logintoboggan


Check your variables table for (and delete) any entries with values like '%http://your.old.domain%'. 


drush vget | grep your.old.domain

drush vdel some_variable_name