Is there a way to retrieve all user sessions and sessions for the current login user from the session table in laravel?
I have database table for session and populates when users login.
The laravel documentation on https://laravel.com/docs/8.x/session shows how to store and retrieve data from the session but it does not show how to manage sessions.
If you use the database driver you could create a model for the sessions table (important note, it doesn't have the default timestamps) With that you could load it like any other data and list or delete it.
Small warning: if you want to change the payload (the data stored in the session) you need to be careful because you can damage that session and create strange situations. But showing the sessions with data like ip and user_agent and deleting other sessions should be possible.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community