How to properly implement Database Sessions in Laravel 11

Hello,

I’m attempting to implement Auth0 Authentication with Laravel 11.35. I have it setup properly and working after copying some of the example for Laravel found here:

https://github.com/auth0/laravel-auth0?tab=readme-ov-file

I am using auth0/login version 7.15.0.

My issue is that I am attempting to use database sessions driver instead of the file sessions driver. I run into an issue where it never completes authentication and begins an infinite loop of login / callback / app.

Any help would be appreciated, thank you.

Hi @jhines,

Thank you for posting! Welcome to the Auth0 Community.

It sounds like the issue could be related to how Telescope interacts with the Auth0 SDK, causing an infinite loop during authentication. I recommend checking the Telescope.md documentation on GitHub.

Hope it helps!

Valerian

Hello, thanks for the response. For those with this issue in the future.
I’ve found the solution to my issue following this guide:
https://github.com/auth0/laravel-auth0/blob/main/docs/Eloquent.md

Following the guide for Auth0 and then reading the Sessions.md unfortunately does not mention that a Eloquent model for the user must be created before the database driver can be used with mysql.

1 Like