419 error on login ONLY when session driver is "database"
After reading through the other posts involving 419 errors on Filament, I have not been able to resolve this issue.
When setting the session driver to
database
, I get a 419 error on logging in, but if I change it to file
instead of database
it works perfectly fine.
A few things: my users table uses uuids
instead of an int, but I have updated the session table migration accordingly, migrated to a completely fresh database, and verified that the database connection works by using tinker to insert a new user into the database.
My migration:
my .env:
I have no idea why changing the session driver to database impacts it like this, but it's only when the driver is database
, if I change it to file
it worksSolution:Jump to solution
sorry for the delay, I was working with a colleague on this, and we discovered that the session migration had the 'id' column set to 'uuid' instead of 'string' and that was throwing off everything, preventing the session from being stored properly, and then couldn't be retreived either.
2 Replies
Sounds like Laravel has issues setting the session 🤔
Can you check whether this simple test works via 2 requests?
and
Solution
sorry for the delay, I was working with a colleague on this, and we discovered that the session migration had the 'id' column set to 'uuid' instead of 'string' and that was throwing off everything, preventing the session from being stored properly, and then couldn't be retreived either.