diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-14 11:33:10 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-14 11:33:10 +0000 |
commit | bbcfb9b625c4ed471fcf7c827b700ccb025e7dd9 (patch) | |
tree | 675bdc39cbb25aa50d58bd0f3e9bf542aee39922 /actionpack/test/controller/session | |
parent | 1f022710488aba694177bb4c33ad99f073eeabb2 (diff) | |
download | rails-bbcfb9b625c4ed471fcf7c827b700ccb025e7dd9.tar.gz rails-bbcfb9b625c4ed471fcf7c827b700ccb025e7dd9.tar.bz2 rails-bbcfb9b625c4ed471fcf7c827b700ccb025e7dd9.zip |
Cookie session store: ensure that new sessions doesn't reuse data from a deleted session in the same request.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6424 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/session')
-rwxr-xr-x | actionpack/test/controller/session/cookie_store_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/test/controller/session/cookie_store_test.rb b/actionpack/test/controller/session/cookie_store_test.rb index 88425b9f02..7d254e4f84 100755 --- a/actionpack/test/controller/session/cookie_store_test.rb +++ b/actionpack/test/controller/session/cookie_store_test.rb @@ -135,6 +135,19 @@ class CookieStoreTest < Test::Unit::TestCase end end + def test_new_session_doesnt_reuse_deleted_cookie_data + set_cookie! cookie_value(:typical) + + new_session do |session| + assert_not_nil session['user_id'] + session.delete + + # Start a new session using the same CGI instance. + post_delete_session = CGI::Session.new(session.cgi, self.class.default_session_options) + assert_nil post_delete_session['user_id'] + end + end + private def assert_no_cookies(session) assert_nil session.cgi.output_cookies, session.cgi.output_cookies.inspect |