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. http://support.microsoft.com/kb/909264

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.

5 comments:

Mike said...

Thanks alot for the post! This solved my problem of session cookies not being saved in my Rails app (just reused my older online shop system which worked before, but suddenly stopped working..) The problem was with my test server being called amtes_shop.local :)

viraj said...

Thank you sir! :)

Anonymous said...

Thanks!!!!

Anonymous said...

I love you, man :)
Thanks a million!

Marcus said...

Just saved me hours, Thanks!