I have an application that has subdomains based on account (i.e. user1.example.com) but I want one login for the whole system, no matter what subdomain/account your in. In rails 2.2 I’d set it up by setting:

ActionController::CgiRequest::DEFAULT_SESSION_OPTIONS[:session_domain] = '.domain.com'

Notice the leading ‘.’ (very much needed)

But in rails 2.3 it doesn’t work, so I found from Mark Gandolfo you can set it using:

config.action_controller.session = {
:session_key => '_my_session_id',
:secret => '..your_secret_code_here..',
:domain => ".domain.com"
}

Hope that helps someone! šŸ˜‰

UPDATE:

If what I’m showing here is to simple for your needs, I did find a great post on how to deal with multiple domains (not just subdomains) in rails 2.3 at Code Tunes