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

MattPurland's avatar

Session token invalidates on ajax call

(Also posted on laravel.io)

I know this question has been asked many times before but I've Googled it to the point of madness, so hopefully someone can shed some light.

I've taken over a project which is running perfectly on its live server as well as my local environment (homestead). But I'm trying to get the application to run on our cloud hosting provider (Cloudways) to some degree of success. The problem is that whenever there's an ajax call to the application the session is recreated and as a result causing a TokenMismatchException.

Does anyone have any ideas as to why it would work on its current live server and locally, but not on a new server?

Thanks in advance

0 likes
0 replies

Please or to participate in this conversation.