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.
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 ;)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community