subdomain-authentication
subdomain-authentication copied to clipboard
Session (and logged in user) not maintained across subdomains
If you are having this problem: You log in as a user, and change to some subdomain and you're no longer logged in as the current user, and when your return to the main domain you're still logged in.
To resolve this, and maintain the current user across subdomains, try setting the session domain in environments/production.rb: config.action_controller.session = { :domain => ‘.YOURDOMAIN.COM’ } (note the leading dot on the domain name).
See this blog post for more information: http://garrickvanburen.com/archive/rails-cookie-settings-for-cross-subdomain-sessions