php sessions - displaying session variables

Associate
Joined
11 Oct 2008
Posts
268
I have made a simple login script using sessions, when the user logs in they make a session[username] variable. What i wanted to do was display all the users that are logged in, but i cannot find any good guides on how to display all the session usernames that may be stored on the server.

does anyone know how i would go about doing this? thanks
 
Have a look at PHP's documentation for session_save_path() - you'll probably want to set the save path to a known folder, then it's a simple case of trawling through the files in that folder. Or use a custom session handler that saves them in the database.
 
Back
Top Bottom