Answer the question
In order to leave comments, you need to log in
How to fix the error: Session store not set on request?
I'm trying to log in, but the following error occurs:
Here are my roots:
Well, the controllers are those in the Laravel boxes, registration is normal, but authorization is not. The roots are in the api.php file.
I looked in Google, you need to type these roots into:
Route::group(['middleware' => ['web']], function () {
});
Answer the question
In order to leave comments, you need to log in
Look at the file RouteServiceProvider
, at the block mapWebRoutes
and mapApiRoutes
, they have different groups middleware's
.
Let 's api
say there are no cookies and sessions, etc.
Although a lot of time has passed, I will still write a solution that helped me in this matter.
In the app/Http/Kernel.php file, you need to edit the api group as follows
'api' => [
\Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question