Sharing sessions across sub-domains
Posted by Jeff Kupperman Wed, 04 Apr 2007 20:34:21 GMT
Here's the answer (I think) to how we will share logins across each of the modules in the Trauma/Burn project:
This line goes in config/environments/ production.rb or development.rb:
ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS.update
( :session_domain => '.example.com')
Note the . before example.com , that is what makes the sessions work
between subdomains.
(Thanks to Ezra Zygmuntowicz's post on the rubyonrails list.)
When we go into production, we'll put each module on a different sub-domain, and then this should work ... as long as we're naming all our session variables the same way. Of course, we need to choose a domain name first....
Spread the word.
Jeff Kupperman supports RSS (Real Simple Syndication), and Trackbacks from other blogs.
Your Comments.
Leave your own response