Link to home
Start Free TrialLog in
Avatar of Refael
RefaelFlag for United States of America

asked on

Display current logged users


Hello Experts,

In a php web application with a user login. Also there is a server-side login (protected floder).
The script start with:

============================
"ob_start();
session_start();
include(/config.inc.php');
session_regenerate_id();
============================

when i login i see my name but i would like to display all the current logged users.
How is it possible?

Thanks!
SOLUTION
Avatar of lexlythius
lexlythius
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry, not necessarily a permanent storage.

Memcache is an on-memory table, and you can also use MySQL's MEMORY engine.
If you want to display just the number of logged users you can play a simpler trick: count the files in your PHP's session storage directory. But this trick only works assuming that:

You have read access to your server's session storage directory;
your site has its own separate session storage directory, and
the mechanism for session garbage collection (clearing old session files) is working properly
ASKER CERTIFIED SOLUTION
Avatar of p_nuts
p_nuts
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Refael

ASKER

thanks guys, but for newbie its not that easy to follow... an example would have been great to have.