diff options
author | José Valim <jose.valim@gmail.com> | 2011-11-23 12:58:56 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-11-23 12:58:56 -0800 |
commit | e6cfd853613f9d9e0232512146e40db4ee232a3c (patch) | |
tree | 824319d4261f200ff499e6900bc68841ec41c9a5 /actionpack/lib/action_dispatch/middleware | |
parent | 40b19e063592fc30705f17aafe6a458e7b622ff2 (diff) | |
parent | 98a1717e7c094d011c89ea1ed88673a595af2de8 (diff) | |
download | rails-e6cfd853613f9d9e0232512146e40db4ee232a3c.tar.gz rails-e6cfd853613f9d9e0232512146e40db4ee232a3c.tar.bz2 rails-e6cfd853613f9d9e0232512146e40db4ee232a3c.zip |
Merge pull request #3739 from lest/config-always-write-cookie
configuration option to always write cookie
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/cookies.rb b/actionpack/lib/action_dispatch/middleware/cookies.rb index a4ffd40a66..51cec41a34 100644 --- a/actionpack/lib/action_dispatch/middleware/cookies.rb +++ b/actionpack/lib/action_dispatch/middleware/cookies.rb @@ -243,10 +243,13 @@ module ActionDispatch @delete_cookies.clear end + mattr_accessor :always_write_cookie + self.always_write_cookie = false + private def write_cookie?(cookie) - @secure || !cookie[:secure] || defined?(Rails.env) && Rails.env.development? + @secure || !cookie[:secure] || always_write_cookie end end |