Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Chaeril's avatar

TokenMismatchException after upgrading to 5.7

I keep getting csrf error after upgrade 5.6 to 5.7, happens if i login or register, i checked kernel file ( added 'verify' route and middlewarePriority ), verifycsrftoken middleware ( addHttpCookie =true ) side by side from a clean repo of 5.7, cleared cache, optimize:clear. but it does not help. @csrf is there, and i could see _token being sent along login data.

any suggestion?

0 likes
1 reply
Chaeril's avatar
Chaeril
OP
Best Answer
Level 1

it was session, seems it wont register, tried most of the stuff around that asking to change this and that but not sure which one helped, secure cookie was true while my app was local so it's probably one, the other one that i changed cookie name to _{{APP_NAME}} without _session behind it. it works after restarting artisan serve (and computer..)

Please or to participate in this conversation.