From 000edbbbaceedc2f6df2b039d44de6e7cb7118e7 Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Fri, 31 Aug 2012 11:36:05 -0700 Subject: Properly reset the session on reset_session Fixes #7478 --- actionpack/lib/action_dispatch/http/request.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_dispatch/http/request.rb') diff --git a/actionpack/lib/action_dispatch/http/request.rb b/actionpack/lib/action_dispatch/http/request.rb index d24c7c7f3f..b8ebeb408f 100644 --- a/actionpack/lib/action_dispatch/http/request.rb +++ b/actionpack/lib/action_dispatch/http/request.rb @@ -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 -- cgit v1.2.3