Rails - Multiple top level domains and a single session/cookie

Posted by Thadius B on Stack Overflow See other posts from Stack Overflow or by Thadius B
Published on 2008-12-18T07:48:32Z Indexed on 2010/05/23 12:20 UTC
Read the original article Hit count: 417

Filed under:
|
|
|

Hello all,

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.

My understanding is that this needs to be set in environment.rb and called with before_dispatch. This is what I've come up with:

 require 'activesupport'
  require 'dispatcher'
  module ActionController
    class Dispatcher

      def set_session_domain
        ActionController::Base.session_options.update :session_domain => "#{@request.host}"
      end 

      before_dispatch :set_session_domain
    end
  end


However, this does not seem to be working when I try and pull the values from session[:session_domain].

Any help is greatly appreciated.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby