Page 1 of 1

Displaying users online using sessions

Posted: Tue Jul 08, 2008 1:41 pm
by Kivork
I want to be able to show the current users online. I've found a script that counts the number of active usrs online, however if I modify it slightly to display those user's usernames (by directly reading raw data from the session files) I get no output.
Is access to these files denied due to security issues? And if so what would be the simplist alternative?

Re: Displaying users online using sessions

Posted: Tue Jul 08, 2008 3:13 pm
by koen.h
Session data is serialized. If that's not the problem maybe you could give us the part of the script that doesn't do what you expect it to do.

Re: Displaying users online using sessions

Posted: Tue Jul 08, 2008 4:35 pm
by Kivork
I figured out the problem, or at least a solution. It seemed I was not able to correctly read the session file after calling session_start(), which I guess makes sense. I simply removed that call in the script and I was able to read the file fine.

Thank you for your help.