Laravel - not extracting user details from session

Hello everyone,

I’ve went through the instructions in the site to set up my web-based Laravel application, has successfully connected it to the application and can see successful logins under the user logs tab.

The problem that I’m getting, however, is the ability to retrieve my user via Auth::user() or Auth::check() calls, that return null. What else that must be done so that Laravel processes session cookies and return a structure that contains user information?

I have tried persisting user information in laravel-auth0.php file to no avail. What else should be done to receive a valid user from session?

Nevermind, I figured that the problem was in the session driver configuration in .env file which was incorrect and thus wasn’t saving session. After changing it to ‘file’ it has started working and Auth::user() is returning the structure for authenticated user.

2 Likes

Perfect and thanks for sharing with the rest of community!