Using rails 4, ruby 2.
I've set a timeout time of 30 minutes for my cookie session in the rails config. The problem is if I go to a form, let the session timeout, and then submit the form, I get this ActionController::InvalidAuthenticityToken
error.
How do I gracefully handle this error in rails? Say, redirect to login screen?
At your ApplicationController
:
rescue_from ActionController::InvalidAuthenticityToken do
redirect_to some_path
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With