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

adw-cr@hotmail.com's avatar

How i can know(determine) when finish a session ?

how i can know when finish a session ?

0 likes
3 replies
jlrdw's avatar

Of course a redirect to a logout page is helpful, but some don't logout, so have an expiration time set.

2 likes
jekinney's avatar

By default a session has an expiration time set in the conf folder. Laravel renews the session on each request and set a remember variable to renew users who chose remember for login.

This can all be configured for your needs and use different session drivers etc. I believe (can't remember off the top of my head) that sessions are checked via a web middleware.

Snapey's avatar

You can only know when a session is finished when someone tries to use it and it has expired.

Its not like there is a job running to close down sessions.

Old sessions are cleaned up periodically on a random basis as new users come to the site.

how i can know when finish a session ?

who needs to know, the client or the server?

Please or to participate in this conversation.