aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-02-04 14:12:26 -0500
committerGitHub <noreply@github.com>2019-02-04 14:12:26 -0500
commit2299d31c4cad93992c6bacba21e01fcdd93e0930 (patch)
tree41545fbbcbca0bd20a7b1998dcc573f40d624022 /actionpack/lib/action_dispatch/middleware
parent744dc1090ddcd97fde87da3333e3984255c0d55a (diff)
parent5c668309122e708f304aad959b6328bcaf586e31 (diff)
downloadrails-2299d31c4cad93992c6bacba21e01fcdd93e0930.tar.gz
rails-2299d31c4cad93992c6bacba21e01fcdd93e0930.tar.bz2
rails-2299d31c4cad93992c6bacba21e01fcdd93e0930.zip
Merge pull request #35134 from Edouard-chin/ec-cookie-expiry-regression
Cookie doesn't expire anymore unless a flag is set:
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r--actionpack/lib/action_dispatch/middleware/cookies.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb
index cb28baa229..1611a8b3dd 100644
--- a/actionpack/lib/action_dispatch/middleware/cookies.rb
+++ b/actionpack/lib/action_dispatch/middleware/cookies.rb
@@ -488,13 +488,8 @@ module ActionDispatch
end
def cookie_metadata(name, options)
- if request.use_cookies_with_metadata
- metadata = expiry_options(options)
- metadata[:purpose] = "cookie.#{name}"
-
- metadata
- else
- {}
+ expiry_options(options).tap do |metadata|
+ metadata[:purpose] = "cookie.#{name}" if request.use_cookies_with_metadata
end
end