PHP sessions do not work like that; nothing happens with the session unless there is a Request that check the Session.
You can use a Presence channel to achieve the type of functionality you need.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I'm searching how to bind the expiration of a session with an event.
'lifetime' => 120,
'expire_on_close' => true,
In the users table, I have a connected field to identify who is connected.
When the lifetime is over or the browser is closed, I want to automatically set connected to false.
How is it possible to do that ?
I had the idea to make an event (session expired event) and with a listener I could update the connected field.
I have searched without finding any solution.
Thanks for your help.
Vincent
@vincent15000 I assume you want to know who is connected???
Presence channels build on the security of private channels while exposing the additional feature of awareness of who is subscribed to the channel
Please or to participate in this conversation.