Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ahmeda's avatar
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"
0 likes
0 replies

Please or to participate in this conversation.