aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Loupasakis <andreas@aloop.org>2012-09-02 00:41:23 +0300
committerSteve Klabnik <steve@steveklabnik.com>2012-09-01 16:35:52 -0700
commit8bfcb0de3a2599925ce714cddc49d608ff8e03a8 (patch)
tree23b4e3d9a1b832da6854ec28baf55796e1470300
parent7fd6bd69e65b8cf9b844c46b98f79fb4b13b1c6a (diff)
downloadrails-8bfcb0de3a2599925ce714cddc49d608ff8e03a8.tar.gz
rails-8bfcb0de3a2599925ce714cddc49d608ff8e03a8.tar.bz2
rails-8bfcb0de3a2599925ce714cddc49d608ff8e03a8.zip
Force reloading of the session after destroy
Use load_for_write! to ensure a refresh of the session object. This way the new session_id and the empty data will be stored properly. E.g. in the case of the session cookie store this means that a new digest will be returned to the user.
-rw-r--r--actionpack/lib/action_dispatch/request/session.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/request/session.rb b/actionpack/lib/action_dispatch/request/session.rb
index 0e0d7a1a33..e17f2a5de6 100644
--- a/actionpack/lib/action_dispatch/request/session.rb
+++ b/actionpack/lib/action_dispatch/request/session.rb
@@ -72,7 +72,10 @@ module ActionDispatch
options = self.options || {}
new_sid = @by.send(:destroy_session, @env, options[:id], options)
options[:id] = new_sid # Reset session id with a new value or nil
+
+ # Load the new sid to be written with the response
@loaded = false
+ load_for_write!
end
def [](key)