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

Marins's avatar

is session active

Hello,

is there a way to know whether the session the user logged in is still active?

Thank you

0 likes
2 replies
Snapey's avatar

Basically the answer is no

If you could write such code, where would you run it?

What would trigger it to run?

jlrdw's avatar

@Marins an equally important question is where is the user logged in at.

If just a forum, blog site, etc you really have no way of forcing the user to hit log out

But if in a big company, or a State Government that user better log out.

In the State of Texas, Dept of Human resources it's State law to log out. If you don't you are subject to possible jail time and a hefty fine. You can verify this for yourself. The system deals with medical, thus very strict.

Why are you needing to know?

Please or to participate in this conversation.