Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

akashgupta's avatar

How to maintain the session login time and logout time in database in laravel? Provide the perfect solution...!

How to maintain the session login time and logout time in the database in laravel? Provide the perfect solution...!

0 likes
1 reply
Snapey's avatar

Its not practical to have a logout time.

You can have a "last seen" time? Start a record when the login and then introduce middleware that updates the same 'end' timestamp each time they access the system.

When they stop accessing the system, the last access time will remain.

You can action on Logout, but how many users actually logout, versus just go away?

Please or to participate in this conversation.