Sometimes interrupting changes raises an ActionDispatch :: Session :: SessionRestoreError exception. It would be great to do something like this to automatically flush invalid sessions:
class ApplicationController < ActionController::Base
rescue_from ActionDispatch::Session::SessionRestoreError do |exception|
reset_session
redirect_to :home
end
end
This does not work. I assume that the exception occurs at the lower level of the ActionDispatch. Is there a way to repair these errors?
source
share