Is the CSRF token changing on each refresh?
Have you got 'secure' => true but you're on HTTP?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hey, I've been trying to solve this problem for the past few days with no luck. Basically, I have a site that is fine in Laravel Homestead, but when the site was updated to Laravel 5.4 and put on a server, there's been issues with TokenMismatchException.
I've made sure the APP_URL and SESSION_DOMAIN was valid. The secure setting is set to false (regular HTTP server), I made sure everything was in the web route. I've also added CSRF tokens blocks to the header and javascript in the main layout template file.
Any ideas what else I can do? I checked other questions and pages about this issue to no luck.
Thanks.
Got it resolved. The issue was the site was set to APP_DEBUG=true and APP_STATUS=production. I think the debug mode was causing issues or the Laravel DebugBar/IDE-Helper with the site.
Thanks!
Please or to participate in this conversation.