Permalink
Browse files

Properly reset the session on reset_session

Fixes #7478
  • Loading branch information...
1 parent c0b6963 commit 000edbbbaceedc2f6df2b039d44de6e7cb7118e7 @steveklabnik steveklabnik committed Aug 31, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 actionpack/lib/action_dispatch/http/request.rb
@@ -227,8 +227,11 @@ def body_stream #:nodoc:
# TODO This should be broken apart into AD::Request::Session and probably
# be included by the session middleware.
def reset_session
- session.destroy if session && session.respond_to?(:destroy)
- self.session = {}
+ if session && session.respond_to?(:destroy)
+ session.destroy
+ else
+ self.session = {}
+ end
@env['action_dispatch.request.flash_hash'] = nil
end

0 comments on commit 000edbb

Please sign in to comment.