diff options
author | brainopia <brainopia@evilmartians.com> | 2012-04-30 16:55:06 +0400 |
---|---|---|
committer | brainopia <brainopia@evilmartians.com> | 2012-04-30 17:04:17 +0400 |
commit | 2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91 (patch) | |
tree | 9a9a8f0367244c034fd061028551704825a8911e /actionpack/lib/action_dispatch | |
parent | ff2667d21a2c183d031acce44d95d06a8c99c035 (diff) | |
download | rails-2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91.tar.gz rails-2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91.tar.bz2 rails-2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91.zip |
Dont stream back cookie value if it was set to the same value
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index ecb336bb4e..c66bcf2cc9 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -169,12 +169,14 @@ module ActionDispatch options = { :value => value } end - @cookies[key.to_s] = value - handle_options(options) - @set_cookies[key.to_s] = options - @delete_cookies.delete(key.to_s) + if @cookies[key.to_s] != value or options[:expires] + @cookies[key.to_s] = value + @set_cookies[key.to_s] = options + @delete_cookies.delete(key.to_s) + end + value end |