Skip to content

Commit

Permalink
Properly reset the session on reset_session
Browse files Browse the repository at this point in the history
Fixes #7478
  • Loading branch information
steveklabnik committed Aug 31, 2012
1 parent c0b6963 commit 000edbb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions actionpack/lib/action_dispatch/http/request.rb
Expand Up @@ -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

Expand Down

0 comments on commit 000edbb

Please sign in to comment.