419 error code from time to time #512
Replies: 1 comment 1 reply
-
|
Hey @IsraelOrtuno , thanks for raising this!
Even with a tab opened for a long time, it should work fine if you have an active session token for the user via
This should not affect the work because if the cookie is not valid anymore (
Not really, the CSRF cookie is returned from the Laravel API on every response. In cases when the cookie has already expired, the module triggers refetching automatically. Same as the behaviour I mentioned above.
It may help, but it would be nice to understand what the exact cause is. If it fails with 419 because of a missing CSRF cookie in the request - it is one problem, but if we still have a valid cookie which is rejected by Laravel, this is a bit more complicated and even refetching might not solve the issue.
Yes, and it is also done automatically once Laravel returns a successful response on logout, so shouldn't be a problem. I believe it may be related to TTL of the session/cookie on Laravel's side, so if you can reproduce this by tweaking the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am getting a 419 error code from time to time but still not 100% sure of the pattern. I believe it's happening when Laravel may be clearing the session (which seems like can happen without control) but the frontend doesn't refresh the CSRF token.
I believe that some users may leave tabs open so they idle, then maybe come back a few hours later (or days) and submit a form without CSRF being refreshed. Not sure if thats the case.
My questions are:
I feel like using cookie authentication can get broken really easy and for the amount of issues related to 419, seems like hard to configure and use properly.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions