Saturday, September 27, 2008

Problems with IE7 Sessions Not Saved in Rails or PHP

If you are unlucky, your login routine will work in Firefox, Internet Explorer 6, Safari, Opera, or whatever, but it won't persist in Internet Explorer 7. x

I spent days on this one: Login worked great in Firefox, but in IE7 the same credentials resulted in a page that looked like I never attempted to log in. The logs showed me that the user credentials were accepted and the page redirected as expected, but the subsequent page load was absent any sign that I logged in.

Well, check your subdomain. You can't have an underscore in a subdomain.

In this instance, IE7 is inconsistently supporting standards. The browser will accept a badly formatted domain and show you the page in your browser, but will refuse to set the session cookie. Firefox and Safari are not quite so strict.