Module: DomainSwitcher::Cookie
- Defined in:
- lib/domain_switcher/cookie.rb
Class Method Summary collapse
-
.session_stores ⇒ Object
Return sessions current session_stores Warning this it not thread safe for now ! Only works with Rails 3 and Memcached session.
- .switch(domain) ⇒ Object
Class Method Details
.session_stores ⇒ Object
Return sessions current session_stores Warning this it not thread safe for now ! Only works with Rails 3 and Memcached session
7 8 9 10 11 12 13 14 |
# File 'lib/domain_switcher/cookie.rb', line 7 def self.session_stores return @session_stores if @session_stores @session_stores = nil ObjectSpace.each_object(ActionDispatch::Session::MemCacheStore) do |o| @session_stores = o end return @session_stores end |
.switch(domain) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/domain_switcher/cookie.rb', line 16 def self.switch(domain) if o = session_stores = o.instance_variable_get(:@default_options) .update(:domain => domain.) o.instance_variable_set(:@default_options, ) end end |