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

feniixx's avatar

TokenMismatchException in VerifyCsrfToken.php line 46

I get this error frequently, even when i've just logged in, it doesn't happen always, but it happens...

0 likes
1 reply
jasonlewis's avatar

A TokenMismatchException should only occur on requests that are not GET, HEAD, or OPTIONS. Make sure any forms (e.g., login form) are adding an _token field with the csrf_token() as the value.

You can also use the csrf_field() helper function to generate the input field automatically.

Please or to participate in this conversation.