WordPress 2.7 and Safari and the Infinite Login Loop

Posted by on Dec 8, 2008 in Geekery, tips | 2 Comments

Ow. I just spent about an hour bashing my head against a brick wall. I’m trying out the WordPress 2.7 Release Candidate 1 at the moment, on a little local testbed.

Which turned out to be my problem. I installed WordPress fine, on a domain I’d called “gothick_wp.test”, just set up locally on Apache.

But I couldn’t log into it. In Safari. I was stuck at the “infinite login loop” that’ll be familiar to some people. WordPress gets a bit confused, and as soon as you click “login”, it just dumps you back to the login screen with no error message and doesn’t let you in.

It worked okay in Firefox, it turned out, so I figured there must be something odd going on in Safari’s cookies. But no, clearing the cookies, even logging in as a clean user and using totally virgin Safari settings did me no good.

After trying all the obvious things, and getting to the end of my tether, I played a hunch. And changed the local domain name I was playing with to “gothick-wp.test”. And that worked fine. Absolutely fine.

So, it seems like there may be some strange interaction between the WordPress login system (probably the cookies) and underscores in domain names. Changing the underscore to a hyphen fixed my problem.

Of course, I was dumb to use an underscore in the first place. It might work fine locally in many ways, but a hyphen is the One True Separator for domain names (see RFC 3696, section 2, for a clue.)

So, the moral of this story is, even when you’re fiddling with local test hostnames, try sticking to LDH: letters, digits and hyphen. Otherwise you might end up tearing your hair out.

« Book Published! | Conversion to WordPress »

2 Comments

  1. WTJ
    February 3, 2009

    it has nth to do with the browser, but i think tehre’s sth crash at the plugins with the mysql.

  2. gothick
    February 3, 2009

    Could be. But it’s strange that it worked in Firefox…