I wonder if it's possible to check session age somehow with PHP. I have browsed trough stackoverflow and have not found anything. Thanks for all answers in advance.
In case anyone wonder why would I need to know something like this is, I want to show notification on top of the screen on all pages for all people are logged in less then 30 minutes.
Perhaps it isn't best practice but it'll do, in the absence of a native function like
session_time()
.Why not just set
$_SESSION['logged_in_at'] = time()
when the user logs in, then checkif( time() - $_SESSION['logged_in_at'] < 30*60)
?