Rails Sessions Subdomains And Internet Explorer

May 1, 2012

When using Rails, subdomains, and sessions; IE will give you fits. IE cannot handle the subdomains and the cookies that Rails uses to store session data. It will not produce any warnings. It just drops all session data because it considers it a cross-site request even through the TLD is the same.

Also worth noting that IE will remove any sessions from subdomains with underscores. This is why I named the session without any underscores in the Gist, just to be safe.

Quick fix. Make sure you pass the TLD prepended with a “.” as the domain to the session config.

If you would like to be notified the next time I write something, you can subscribe with your choice of RSS or Email.

I promise not to spam you and you can unsubscribe at anytime.

Also, here are some other items you might like longer longer:

or go see everything in the archive.