Jan 14, 2025
0
Level 5
Session store not set on request.
I have Laravel as the backend and Nuxt js as frontend I used Session Sanctum here is the setup:
I got a server error in production while login and generate session:
Session store not set on request.
in my cors.php :
'paths' => ['api/*', 'sanctum/csrf-cookie'],
.......
'supports_credentials' => true,
in app.php
->withMiddleware(function (Middleware $middleware) {
$middleware->statefulApi();
})
in sanctum.php:
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort()
))),
.env file:
SESSION_DRIVER=database
SESSION_LIFETIME=120
SESSION_DOMAIN=".domain.net"
SESSION_SECURE_COOKIE=true
SANCTUM_STATEFUL_DOMAINS="new.domain.net"
Please or to participate in this conversation.