https://laravel.com/docs/8.x/csrf#csrf-x-csrf-token
I have no experience in this issue.
Since you ask send it manually, maybe you can refer to this, set the Axios header, just a suggestion.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I just want to say that Laravel needs to update their docs!
I found out why my frontend never succeeded in saving the XSRF-TOKEN: It's beacuse I didn't change SESSION_DRIVER to cookie in the .env file. The default is SESSION_DRIVER=file, and nowhere in the doc is it mentioned. Not even in Sanctum docs.
Now that I see my XSRF token saved in the browser (Some encrypted long string). How can I send it back with the POST requests with Axios from the frontend?
The frontend is on localhost:3000 and the Laravel API on localhost:8080 and that' s why Axios might not be sending this token back.
So how can I send it manually?
Please or to participate in this conversation.