Hello, I'm using Axios in Angular to send a GET request to '/sanctum/csrf-cookie' to obtain cookies (XSRF-TOKEN, laravel_session). However, when I subsequently send a POST request to Laravel with these cookies, I receive a "419 Page Expired (CSRF Token Mismatch)" error. When I inspect the request headers, I can see that the cookies are being sent, but I'm still getting the 419 error. The issue is that it was working perfectly a week ago, but it started giving this error today.
Angular/index.component.ts:
const Request = axios.create({
baseURL:'http:// localhost:8000',
withCredentials: true
})
Request.get('/sanctum/csrf-cookie').then(() => {
Request.post('/').then((e) => {
console.log(e.data)
})
})
Laravel/.env:
SESSION_DOMAIN=localhost
SANCTUM_STATEFUL_DOMAINS=localhost
APP_URL=http:// localhost:8000
FRONTEND_URL=http:// localhost:4200
Laravel/cors.php:
'paths' => ['*'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,