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

likwidmonster's avatar

Laravel Random Verify CSRF Token Error

I currently have a web application in the process of being built in Laravel 5.3.

I have it running locally on my MacBook Pro using Laravel Valet with a SQL Server. All intended functionality works.

I then uploaded it up to my Ubuntu web server on DigitalOcean and have had it up there ever since I started this project ( 8 months ago ) without any issues.

For a specific form POST Request I am receiving a Token Mismatch Error:

TokenMismatchException in VerifyCsrfToken.php line 68 The user is already logged in and other POST Requests on the application work. The form has the correct CSRF Token inside of the form and has the token stored in the head of the page under a meta tag ( ).

I am not having this issue locally and they both have the same Database Schema and Content.

I fail to understand why this issue would only happen on the web server.

Any help is much appreciated.

0 likes
3 replies
Snapey's avatar

I know you say that the form has the token, but just check by using network tools in your browser, click the form submit and look at the request data

likwidmonster's avatar

In the Developer Tools, I saw the Form Data that was submitted and I see _token:99YEqK44b9MfMTb2nf5CGLBqL3uOr4e6AAWXGumq

Please or to participate in this conversation.