diff options
author | brainopia <brainopia@evilmartians.com> | 2012-04-30 16:55:06 +0400 |
---|---|---|
committer | brainopia <brainopia@evilmartians.com> | 2012-08-10 10:00:04 +0400 |
commit | bbe634e72cfbe9d66f08e0e22b0c718f136ae934 (patch) | |
tree | a6ef2dd7dc99f1215b9f254f0318a89123f6f5e9 /actionpack/lib | |
parent | 058dc9a09680e9e2a5777c441b966a6f5e12cf82 (diff) | |
download | rails-bbe634e72cfbe9d66f08e0e22b0c718f136ae934.tar.gz rails-bbe634e72cfbe9d66f08e0e22b0c718f136ae934.tar.bz2 rails-bbe634e72cfbe9d66f08e0e22b0c718f136ae934.zip |
Dont stream back cookie value if it was set to the same value
Diffstat (limited to 'actionpack/lib')
-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 2f46a375b1..2e9f7e569b 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -170,12 +170,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 |