I have vue app & backend laravel , for auth use SPA Authentication
Everything is fine in localhost but in server have some issue
I send login request to sanctum/csrf-cookie then /login and return 200 and logged but when redirect to dashboard get error :
CSRF token mismatch.
this issue only in google chorme but in firefox works fine
I have two sub domain : app.mydomain.com and api.mydomain.com
SANCTUM_STATEFUL_DOMAINS=app.mydoamin.com
SESSION_DOMAIN=.mydoamin.com
also in vue app :
window.axios.defaults.withCredentials = true
my cros settings: 'paths' => ['api/*', 'sanctum/csrf-cookie','login-user'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,