Rails 4 ActionController :: InvalidAuthenticityToken error when cookies are not accepted

Using protect_from_forgery in Rails 4 seems to always expect a cookie, otherwise ActionController::InvalidAuthenticityToken arises when using

 protect_from_forgery with: :exception 

if the browser does not accept cookies.

Are there alternative ways to do CSRF when cookies are not accepted? At the moment, I am choosing to notify the user that cookies are required. Is this the right approach?

+5
source share

Source: https://habr.com/ru/post/1233229/


All Articles