1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Properly reset the session on reset_session

Fixes #7478
This commit is contained in:
Steve Klabnik 2012-08-31 11:36:05 -07:00
parent c0b6963049
commit 000edbbbac

View file

@ -227,8 +227,11 @@ module ActionDispatch
# 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