aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorbrainopia <brainopia@evilmartians.com>2012-04-30 16:55:06 +0400
committerbrainopia <brainopia@evilmartians.com>2012-04-30 17:04:17 +0400
commit2d18dd34719b1f9a3d2e3a516ccb83e7067dcd91 (patch)
tree9a9a8f0367244c034fd061028551704825a8911e /actionpack/lib/action_dispatch
parentff2667d21a2c183d031acce44d95d06a8c99c035 (diff)
downloadrails-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.rb10
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