title: Rails - Multiple top level domains and a single session/cookie
body: <p>I've been struggling with this for quite awhile and haven't been able to
  find a solution. I need a user to be able to view multiple top level
  domains with a single login.</p>
  
  <p>My understanding is that this needs to be set in <code>environment.rb</code> and
  called with <code>before_dispatch</code>. This is what I've come up with:</p>
  
  <pre><code>require 'activesupport'
  require 'dispatcher'
  module ActionController
     class Dispatcher
  
        def set_session_domain
           ActionController::Base.session_options.update :session_domain =&gt; "#{@request.host}"
        end 
  
        before_dispatch :set_session_domain
     end
  end
  </code></pre>
  
  <p>However, this does not seem to be working when I try and pull the values
  from <code>session[:session_domain]</code>.</p>
  
  <p>Any help is greatly appreciated.</p>