diff options
author | lest <just.lest@gmail.com> | 2011-11-23 23:36:56 +0300 |
---|---|---|
committer | lest <just.lest@gmail.com> | 2011-11-23 23:50:04 +0300 |
commit | 98a1717e7c094d011c89ea1ed88673a595af2de8 (patch) | |
tree | 24fcc58fdef79730ae0840c4e1d35c532df8cd4e /actionpack/lib/action_dispatch/middleware | |
parent | 8549f7a4f0c30c37050666f5661ea9e270a298fd (diff) | |
download | rails-98a1717e7c094d011c89ea1ed88673a595af2de8.tar.gz rails-98a1717e7c094d011c89ea1ed88673a595af2de8.tar.bz2 rails-98a1717e7c094d011c89ea1ed88673a595af2de8.zip |
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 |