diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2012-08-31 11:36:05 -0700 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2012-08-31 12:25:46 -0700 |
commit | 000edbbbaceedc2f6df2b039d44de6e7cb7118e7 (patch) | |
tree | a6a31ab78c198120d239b28a38659a72c57a029b /actionpack/lib | |
parent | c0b696304995628f03a51ad42e41ceede1c704d6 (diff) | |
download | rails-000edbbbaceedc2f6df2b039d44de6e7cb7118e7.tar.gz rails-000edbbbaceedc2f6df2b039d44de6e7cb7118e7.tar.bz2 rails-000edbbbaceedc2f6df2b039d44de6e7cb7118e7.zip |
Properly reset the session on reset_session
Fixes #7478
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/http/request.rb | 7 |
1 files changed, 5 insertions, 2 deletions
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 |