laravel-vue-starter icon indicating copy to clipboard operation
laravel-vue-starter copied to clipboard

CSRF token mismatch.

Open menphurk236 opened this issue 2 years ago • 4 comments

image

run command : php artisan serve

my .env config APP_URL=http://127.0.0.1:8000 SANCTUM_STATEFUL_DOMAINS=127.0.0.1:8000 SESSION_DOMAIN=localhost

menphurk236 avatar Oct 07 '23 13:10 menphurk236

Hey @menphurk236

I have no idea what could be wrong because i don't use artisan serve.

I recommend to run this project with Laravel Homestead or Laravel Valet.

Best Regards, Darko

gdarko avatar Oct 07 '23 14:10 gdarko

Hello @menphurk236,

I've added the following environment variables with these values:

APP_URL=http://localhost:8000/ SANCTUM_STATEFUL_DOMAINS=localhost:8000 SESSION_DOMAIN=localhost SPA_URL="${APP_URL}" This adjustment resolved the issue.

Best Regards, Krishna

krishnahimself avatar Oct 09 '23 06:10 krishnahimself

I have fixed this issue by change the browser url to http://localhost:8000 By default, if you press ctrl + click on the url on your terminal, then browser will open http://127.0.0.1:8000 This will cause the problem.

fecoderchinh avatar Oct 28 '23 01:10 fecoderchinh