niclas-timm / laravel-nextjs-starter

A Starter Kit for applications with Laravel as the API and NextJS for the Frontend
308 stars 82 forks source link

CSRF token mismatch #34

Open devlamine opened 3 years ago

devlamine commented 3 years ago

HI, after installation de scripts I have message "message": "CSRF token mismatch.",

I have laravel code executed in domaine app.test and client in localhost:3000

SESSION_DOMAIN=localhost SANCTUM_STATEFUL_DOMAINS=localhost:3000

niclas-timm commented 3 years ago

Is this still an isseu? Looks correct on first sight.

ganjargal commented 3 years ago

Is this still an isseu? Looks correct on first sight.

The same issue happened to me

diazsasak commented 2 years ago

i got the same error too. the yellow warning sign said this https://stackoverflow.com/questions/62749492/set-cookie-was-blocked-because-its-domain-attribute-was-invalid-with-regards-to

image

diazsasak commented 2 years ago

I got it working.

need to use same tld domain api. and www. and same port 80

image