From 44830ead1c88e1c45124133ce3e2ed9f890f42de Mon Sep 17 00:00:00 2001 From: Rizwan Reza Date: Fri, 11 Jun 2010 10:25:39 +0430 Subject: 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. --- .../test/dispatch/session/cookie_store_test.rb | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'actionpack/test/dispatch/session') 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 -- cgit v1.2.3