diff options
author | wycats <wycats@gmail.com> | 2010-06-04 10:03:53 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-06-04 20:11:05 -0700 |
commit | cb1b2a719ac2ba31dc8d66195c0be32798255be0 (patch) | |
tree | bc7ebac887f951dca604c7e477c47bdd8aac5d02 /actionpack | |
parent | a260e02fd3e967d2d6b602aa3bd15f952d4e45cc (diff) | |
download | rails-cb1b2a719ac2ba31dc8d66195c0be32798255be0.tar.gz rails-cb1b2a719ac2ba31dc8d66195c0be32798255be0.tar.bz2 rails-cb1b2a719ac2ba31dc8d66195c0be32798255be0.zip |
Stop the flash middleware from forcibly loading sessions even if the user doesn't use sessions at all
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/flash.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_dispatch/middleware/session/abstract_store.rb | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/lib/action_dispatch/middleware/flash.rb b/actionpack/lib/action_dispatch/middleware/flash.rb index adde183cdb..043966a585 100644 --- a/actionpack/lib/action_dispatch/middleware/flash.rb +++ b/actionpack/lib/action_dispatch/middleware/flash.rb @@ -170,13 +170,13 @@ module ActionDispatch end def call(env) - if (session = env['rack.session']) && (flash = session['flash']) + if (session = env['rack.session']) && session.key?('flash') flash.sweep end @app.call(env) ensure - if (session = env['rack.session']) && (flash = session['flash']) && flash.empty? + if (session = env['rack.session']) && session.key?('flash') && session['flash'].empty? session.delete('flash') end end diff --git a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb index 15493cd2eb..3e8d64b0c6 100644 --- a/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb +++ b/actionpack/lib/action_dispatch/middleware/session/abstract_store.rb @@ -51,11 +51,11 @@ module ActionDispatch super end - private - def loaded? - @loaded - end + def loaded? + @loaded + end + private def load! stale_session_check! do id, session = @by.send(:load_session, @env) |