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

mad_dev's avatar

ReactJS fetch creating a new session

Im simply trying to run a few fetch requests from a React JS component and keep getting CSRF errors. I have debugged tirelessly, trying all headers and '_token' bodies, however nothing works. I have also debugged the tokensMatch() function in VerifyCsrfToken and can see that the tokens and sessions are different to those seen when posting normal requests. I am assuming its a React issue as a standard $.ajax works. Has anyone experienced this before?

0 likes
0 replies

Please or to participate in this conversation.