diff options
author | José Valim <jose.valim@gmail.com> | 2010-06-10 20:05:48 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-10 20:08:01 +0200 |
commit | 330a89072a493aafef1e07c3558964477f85adf0 (patch) | |
tree | 4bcdcaf5ab5123ca425bdc3fd8bfe98f4b558441 /actionpack/lib/action_dispatch | |
parent | d93b45e8d32e3c4917c6b16bcea3a694800d2c49 (diff) | |
download | rails-330a89072a493aafef1e07c3558964477f85adf0.tar.gz rails-330a89072a493aafef1e07c3558964477f85adf0.tar.bz2 rails-330a89072a493aafef1e07c3558964477f85adf0.zip |
Revert "Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. [#4818 state:resolved]"
It does not work for domains like co.uk and com.br.
This reverts commit c4d6245e875bbb276c122a5a401422d341dac4df.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/session/abstract_store.rb | 7 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/session/cookie_store.rb | 8 |
2 files changed, 1 insertions, 14 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index 040a83f7a6..3e8d64b0c6 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -121,12 +121,7 @@ module ActionDispatch unless options[:expire_after].nil? cookie[:expires] = Time.now + options.delete(:expire_after) end - - if options[:domain] == :all - top_level_domain = env["HTTP_HOST"].split('.')[-2..-1].join('.') - options[:domain] = ".#{top_level_domain}" - end - + request = ActionDispatch::Request.new(env) set_cookie(request, cookie.merge!(options)) end diff --git a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb index 0fc63d026f..92a86ee229 100644 --- a/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/cookie_store.rb @@ -34,14 +34,6 @@ module ActionDispatch # integrity defaults to 'SHA1' but may be any digest provided by OpenSSL, # such as 'MD5', 'RIPEMD160', 'SHA256', etc. # - # * <tt>:domain</tt>: Restrict the session cookie to certain domain level. - # If you use a schema like www.example.com and wants to share session - # with user.example.com set <tt>:domain</tt> to <tt>:all</tt> - # - # :domain => nil # Does not sets cookie domain. (default) - # :domain => :all # Allow the cookie for the top most level - # domain and subdomains. - # # To generate a secret key for an existing application, run # "rake secret" and set the key in config/environment.rb. # |