diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-11 12:57:43 -0700 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-11 12:57:43 -0700 |
commit | 20f18cbc148270112c670189cf5489900a2271dc (patch) | |
tree | 964d287bdd3a089ee6ab41f0f5c1ce44d0ae8f22 /actionpack/lib | |
parent | dad717a5ea525743255b7cc17c28ca087054967a (diff) | |
parent | 2e04a343eb668fe73864156ed9f3c373d42a588c (diff) | |
download | rails-20f18cbc148270112c670189cf5489900a2271dc.tar.gz rails-20f18cbc148270112c670189cf5489900a2271dc.tar.bz2 rails-20f18cbc148270112c670189cf5489900a2271dc.zip |
Merge pull request #7316 from brainopia/backport_fix_session_store_options
Backport of "Support cookie jar options for all cookie stores" for 3.2-stable
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/cookies.rb | 10 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/session/abstract_store.rb | 7 |
2 files changed, 13 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 diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index f75b4d4d04..c04fee21dc 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -74,6 +74,13 @@ module ActionDispatch class AbstractStore < Rack::Session::Abstract::ID include Compatibility include StaleSessionCheck + + private + + def set_cookie(env, session_id, cookie) + request = ActionDispatch::Request.new(env) + request.cookie_jar[key] = cookie + end end end end |