Are you sure cookies are being sent with every subsequent request? For example with axios, you have to set withCredentials or however it is called.
Dec 25, 2021
5
Level 1
Laravel Sanctum App only working on Mozilla
I have laravel API hosted in api.domain.edu.np & react app hosted on app.domain.edu.np
API is built on top of Laravel Sanctum
Problem The app works fine in Mozilla but on other browsers, I get 419 errors in API
API request
/csrf-cookie is OK
/api/v1/login ( returns 419 in all browsers except Mozilla Firefox )
.env configuration
CACHE_DRIVER=file
SESSION_DRIVER=cookie
SESSION_LIFETIME=120
SANCTUM_STATEFUL_DOMAINS=app.domain.edu.np
SESSION_DOMAIN=.domain.edu.np
in localhost works in all browsers with below .env configuration
SANCTUM_STATEFUL_DOMAINS=localhost:3000
SESSION_DOMAIN=localhost
Please or to participate in this conversation.