We have a protected directory on our site, where users are required to login using the .htacces system.
I know we can get the username of the person thats logged in through a PHP variable
$username = $_SERVER[‘REMOTE_USER’];
I’m wondering if it’s possible to show ALL users logged in?
This way we could show something at the top like “The following users are logged in: “
Also, could someone clarify how the sessions work with htaccess, does a person only have to re-login if they close the browser, or does it time out? Thanks
.htaccess Basic Authentication is just that – only authentication. There is no concept of a session associated with it, and thus at any one point in time the server has no idea how many clients have current authentication credentials.
As long as a browser has authentication details, the session won’t time out. Typically, only restarting the browser will result in a browser ‘forgetting’ it’s authentication details.