diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2019-08-05 03:57:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-05 03:57:08 +0200 |
commit | 4f235e9a86d4589f2081f971e5e66d42586333bb (patch) | |
tree | b555b83df541e5fb6b050691f616a9d0c3e6c145 /actionpack/lib/action_dispatch | |
parent | 3d1f6feda2f04f0a3e7a9592142ebe559ea1120a (diff) | |
parent | 27db230bd105e77e27375033ddcb487ef481686b (diff) | |
download | rails-4f235e9a86d4589f2081f971e5e66d42586333bb.tar.gz rails-4f235e9a86d4589f2081f971e5e66d42586333bb.tar.bz2 rails-4f235e9a86d4589f2081f971e5e66d42586333bb.zip |
Merge pull request #36537 from quadule/fix-cookie-rotation-hash-pollution
Fix cookie modification during rotation
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index 96bdf570af..9d94d94ffb 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -532,9 +532,13 @@ module ActionDispatch if value case when needs_migration?(value) - self[name] = Marshal.load(value) + Marshal.load(value).tap do |v| + self[name] = { value: v } + end when rotate - self[name] = serializer.load(value) + serializer.load(value).tap do |v| + self[name] = { value: v } + end else serializer.load(value) end |