Support the ongoing development of Laravel.io →
Configuration Session Laravel
Last updated 2 years ago.
0

Solved by adding \Illuminate\Session\Middleware\StartSession::class,

In Kernel.php

Before 'api' => [ 'throttle:60,1', 'bindings', ],

After 'api' => [ \Illuminate\Session\Middleware\StartSession::class, 'throttle:60,1', 'bindings', ],

0

Its great you were able to solve it but I would not call that the proper solution as an API in itself is stateless which means it has no session

the way we keep track of a session using an API is usually by means of a token one way of doing that with laravel would by by using the standard API authentication driver or if you want to be able to use Oauth2 then use Laravel Passport

These are only suggestion

Best of luck with your Site

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.