aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/session
diff options
context:
space:
mode:
authorRizwan Reza <rizwanreza@gmail.com>2010-06-11 10:25:39 +0430
committerJosé Valim <jose.valim@gmail.com>2010-06-11 16:34:52 +0200
commit44830ead1c88e1c45124133ce3e2ed9f890f42de (patch)
tree60e3ca7b619395cbd9c16c15c43606ae2b81e37d /actionpack/test/dispatch/session
parentb69a2db952497473aacef29ea8c85973e634048f (diff)
downloadrails-44830ead1c88e1c45124133ce3e2ed9f890f42de.tar.gz
rails-44830ead1c88e1c45124133ce3e2ed9f890f42de.tar.bz2
rails-44830ead1c88e1c45124133ce3e2ed9f890f42de.zip
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]
This reverts commit 330a89072a493aafef1e07c3558964477f85adf0.
Diffstat (limited to 'actionpack/test/dispatch/session')
-rw-r--r--actionpack/test/dispatch/session/cookie_store_test.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/session/cookie_store_test.rb b/actionpack/test/dispatch/session/cookie_store_test.rb
index 21d11ff31c..b542824789 100644
--- a/actionpack/test/dispatch/session/cookie_store_test.rb
+++ b/actionpack/test/dispatch/session/cookie_store_test.rb
@@ -185,6 +185,35 @@ class CookieStoreTest < ActionController::IntegrationTest
end
end
+ def test_session_store_with_explicit_domain
+ with_test_route_set(:domain => "example.es") do
+ get '/set_session_value'
+ assert_match /domain=example\.es/, headers['Set-Cookie']
+ headers['Set-Cookie']
+ end
+ end
+
+ def test_session_store_without_domain
+ with_test_route_set do
+ get '/set_session_value'
+ assert_no_match /domain\=/, headers['Set-Cookie']
+ end
+ end
+
+ def test_session_store_with_nil_domain
+ with_test_route_set(:domain => nil) do
+ get '/set_session_value'
+ assert_no_match /domain\=/, headers['Set-Cookie']
+ end
+ end
+
+ def test_session_store_with_all_domains
+ with_test_route_set(:domain => :all) do
+ get '/set_session_value'
+ assert_match /domain=\.example\.com/, headers['Set-Cookie']
+ end
+ end
+
private
# Overwrite get to send SessionSecret in env hash