Support the ongoing development of Laravel.io →
2 years ago
Last updated 3 months ago.
0

Is your api route a route described in api.php? That is a route group that by default doesn't has a session. If you use the sessions to keep the user loggedin (the default for web) it will not be stored.

You can move the route to the web.php or add the session middleware to that route if needed.

0

Because That The api.php is not using the sessions as driver it uses api token,

if you are building login api read more about WebTokens, if not move the login from api.php => web.php OR edit in the app/Providers/RouteServiceProvider.php in the mapApiRoutes and use web middleware instead of api OR edit in auth.php in the api driver from token to sessions.

USE WHAT EVER SUITE YOUR NEED ;)

0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

ShirazSoft ShirazSoft shirazsoft Joined 15 Apr 2020

Moderators

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

Your logo here?

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

© 2022 Laravel.io - All rights reserved.