Intermittently 419 error

We're getting 419 error intermittently after switching our session driver to database, before the session driver was set to file and it was working just fine. Any action like going to a different page, using the search on tables, or using paginate on tables will result in 419 error and ask to refresh, after refreshing doing the same action will work fine. Anyone experience this?
6 Replies
DrByte
DrByte14mo ago
419 can often be caused by an invalid CSRF token, or an invalid/missing/expired session token. It's possible that your client browsers have a cached token for the old session driver, which looks valid on the surface, but doesn't match in your new db. I'd suggest flushing all old session identifiers (like, if your old session driver was "file", delete all the old file-based session files under the storage directory). And, consider maybe changing your session name so it never looks for the older session tokens in your browser because it's only looking for the new session token names. In your config/sessions.php you can see that the session cookie name is by default generated from the APP_NAME followed by _session. So you could either update your APP_NAME (which may not be ideal) or simply set SESSION_COOKIE in your .env.
Incore
Incore14mo ago
I have the same issue, changing driver to file/database changing browser, cleaning cache, changing APP_NAME, still same issue.
saineshmamgain
saineshmamgain11mo ago
I am also facing this issue. Page is getting expired even after a reload. Has anyone found a solution?
Dennis Koch
Dennis Koch11mo ago
Had a similar issue yesterday. It was because my output_buffering setting for PHP was set to 0. I am using Herd and it seems like it overwrote that setting, because it started with one request to the next.
JJSanders
JJSanders11mo ago
I'm facing the same issue when importing a file of ~20 lines
lodeki
lodeki9mo ago
Hey, faciing this issue.You got a walk around?
Want results from more Discord servers?
Add your server