Dynamically setting the session domain?

Does anyone know a way to dynamically change the session_domain option
of ActionController::CgiRequest? I want to have a login section on an
index page (www.example.com) that takes a subdomain, username,
password, authenticates, then redirects to

I need to set the session_domain option (to the subdomain) dynamically
so the cookie can be read when the user arrives after the redirect. I
know I could do
:session_domain => ‘example.com’) if I wanted to share sessions across
domains, but I do not want to do this as I want to allow users to be
logged on to multiple subdomains at the same time.

Any ideas?


I just realized that 37Signal’s Backpack does exactly what I described
below. Any ideas on how this is done?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs