From 04d2d043ca9c59ab93522f1d8c0810cf47f05b23 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 23 Nov 2008 16:42:15 +0100 Subject: Move the cookie store to use the MessageVerifier class. This removes support for ancient cookie-store generated cookies which were double escaped. --- actionpack/test/controller/session/cookie_store_test.rb | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/session/cookie_store_test.rb b/actionpack/test/controller/session/cookie_store_test.rb index 30422314a1..52c1f7559c 100644 --- a/actionpack/test/controller/session/cookie_store_test.rb +++ b/actionpack/test/controller/session/cookie_store_test.rb @@ -45,8 +45,8 @@ class CookieStoreTest < Test::Unit::TestCase { :empty => ['BAgw--0686dcaccc01040f4bd4f35fe160afe9bc04c330', {}], :a_one => ['BAh7BiIGYWkG--5689059497d7f122a7119f171aef81dcfd807fec', { 'a' => 1 }], :typical => ['BAh7ByIMdXNlcl9pZGkBeyIKZmxhc2h7BiILbm90aWNlIgxIZXkgbm93--9d20154623b9eeea05c62ab819be0e2483238759', { 'user_id' => 123, 'flash' => { 'notice' => 'Hey now' }}], - :flashed => ['BAh7ByIMdXNlcl9pZGkBeyIKZmxhc2h7AA==--bf9785a666d3c4ac09f7fe3353496b437546cfbf', { 'user_id' => 123, 'flash' => {} }], - :double_escaped => [CGI.escape('BAh7ByIMdXNlcl9pZGkBeyIKZmxhc2h7AA%3D%3D--bf9785a666d3c4ac09f7fe3353496b437546cfbf'), { 'user_id' => 123, 'flash' => {} }] } + :flashed => ['BAh7ByIMdXNlcl9pZGkBeyIKZmxhc2h7AA==--bf9785a666d3c4ac09f7fe3353496b437546cfbf', { 'user_id' => 123, 'flash' => {} }] + } end @@ -105,15 +105,6 @@ class CookieStoreTest < Test::Unit::TestCase end end - def test_restores_double_encoded_cookies - set_cookie! cookie_value(:double_escaped) - new_session do |session| - session.dbman.restore - assert_equal session["user_id"], 123 - assert_equal session["flash"], {} - end - end - def test_close_doesnt_write_cookie_if_data_is_blank new_session do |session| assert_no_cookies session -- cgit v1.2.3