diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-03 08:18:30 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-03-03 08:18:30 +0000 |
commit | a0563bf7b07f218f23c7f46e2fdb4c5c0fd7d488 (patch) | |
tree | cc94d464f84fcae0390b8a58062cecb0c2fa5fa9 /actionpack/lib/action_controller | |
parent | a7b90b7cdd779fcde2bc3f4c97f69a72ca714440 (diff) | |
download | rails-a0563bf7b07f218f23c7f46e2fdb4c5c0fd7d488.tar.gz rails-a0563bf7b07f218f23c7f46e2fdb4c5c0fd7d488.tar.bz2 rails-a0563bf7b07f218f23c7f46e2fdb4c5c0fd7d488.zip |
Cookie store: test that >4K raises CookieOverflow and that unverifiable cookies are automatically deleted.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6294 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/session/cookie_store.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/session/cookie_store.rb b/actionpack/lib/action_controller/session/cookie_store.rb index 1754eb34b1..e65ff6b262 100644 --- a/actionpack/lib/action_controller/session/cookie_store.rb +++ b/actionpack/lib/action_controller/session/cookie_store.rb @@ -89,7 +89,10 @@ class CGI::Session::CookieStore def unmarshal(cookie) if cookie data, digest = CGI.unescape(cookie).split('--') - raise TamperedWithCookie unless digest == generate_digest(data) + unless digest == generate_digest(data) + delete + raise TamperedWithCookie + end Marshal.load(Base64.decode64(data)) end end |