Ela Buwa
Ela Buwa

Reputation: 1704

Laravel TokenMismatchException after changing session driver

I changed my laravel session driver to database. I changed the session.php file and the ENV file to reflect database. I didn't define a connection and left it default in the session.php file.

I have the session table created through the php artisan command, did the migration.

I come across the "TokenMismatchException in VerifyCsrfToken.php line 67:" error now everytime I submit a form. If I revert back to "file" it goes back to normal.

I have cleared artisan cache clearing, browser history clearing too.

Using laravel 5.2.

Any help is greatly appreciated.

Upvotes: 0

Views: 546

Answers (1)

Waku-2
Waku-2

Reputation: 1196

One reason this can happen is if you created sessions table manually and made the mistake of making id column of type bigint(20) or any other mismatching column. Check my detailed answer here https://stackoverflow.com/a/45340647/7260022

Upvotes: 0

Related Questions