There is random CSRF errors on my app with ActionController::InvalidAuthenticityToken
. Like, one out of 100 requests or more. Why would those errors appears randomly like this?
I got them on some regular <%= form_with %>
tag, some on javascript post (but it works most of the time because I add the meta[name='csrf-token']
as X-CSRF-TOKEN
every time), some on devise/registrations#create
, etc...
Why would it happen sometimes and not every time?
Regards