diff options
author | Prem Sichanugrist <s@sikachu.com> | 2010-06-25 02:42:08 +0700 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-06-25 09:41:52 +0200 |
commit | 617e94658ddc3f71c42fc4f8c2346f87ff106bbe (patch) | |
tree | eeeadd52c680a4b5369978dc4c5dcec3a9ea0901 /actionpack/lib/action_dispatch/middleware | |
parent | a12b76b09e98493c1e4aee147416ae5999402298 (diff) | |
download | rails-617e94658ddc3f71c42fc4f8c2346f87ff106bbe.tar.gz rails-617e94658ddc3f71c42fc4f8c2346f87ff106bbe.tar.bz2 rails-617e94658ddc3f71c42fc4f8c2346f87ff106bbe.zip |
Make sure that Rails doesn't resent session_id cookie over and over again if it's already there [#2485 state:resolved]
This apply to only Active Record store and Memcached store, as they both store only the session_id, which will be unchanged, in the cookie.
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_dispatch/middleware')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/session/abstract_store.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index 2dff139b49..fcc2287279 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -196,7 +196,9 @@ module ActionDispatch end def set_cookie(request, options) - request.cookie_jar[@key] = options + if request.cookie_jar[@key] != options[:value] || !options[:expires].nil? + request.cookie_jar[@key] = options + end end def load_session(env) |