Managing users sessions by laravel authentication mechanism
hello,
first of all im new in Laravel and i used Codeigniter before...
Users in my project have one session for each system they logged in to and each session has its own token.
sessions are stored in sessions table and sessions table is related to users table for retrieving the users informations by token
User token and authentication is written by me and I do not use Laravel authentication system because I recently transferred my project from Codeigniter to Laravel.
so how can i manage this sessions and token generation with laravel authenticating system ?
You can also use Fortify and do some simple transformations in the users table if needed, then you will have a strong and secure authentication system.
im generating token by my self and send it to the front end and validate it by custom middleware before every routes.
my goal for using laravel authenticating system is that i want to use broadcast private channels with laravel-echo-server and authenticating private channels needs laravel auth system
@Jordi.El.Nino.Pola Oh okay! Then Laravel's authentication system handles everything for you. Read the docs on authentication sessions and authorization. Everything is well laid out. You might not even need your sessions migration, depending. See how you can do without it if it's not needed
@Jordi.El.Nino.Pola You only need Laravel Sanctum if you're accessing the backend through an API, especially if your application is an SPA (JavaScript-rendered frontend). Use Fortify if you're not accessing the backend through an API
@Jordi.El.Nino.Pola Very well! You can use Sanctum. It will help to setup the session management, authentication and authorization sequences. Read the docs for more details