Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 8bfcb0de3a2599925ce714cddc49d608ff8e03a8 1 parent 7fd6bd6
@alup alup authored steveklabnik committed
Showing with 3 additions and 0 deletions.
  1. +3 −0  actionpack/lib/action_dispatch/request/session.rb
3  actionpack/lib/action_dispatch/request/session.rb
@@ -72,7 +72,10 @@ def destroy
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!
def [](key)
Please sign in to comment.
Something went wrong with that request. Please try again.