in php.ini you'll find a variable session.save_path which specifies where session files are kept. Each time a session is created, a file is created here with the name set to the session id. The theory behind user counts is to use the filesystem functions to count the number of files in this directory, and that is the number of users online.
What you can do extra to that is when a user logs in, store his/her session id - then, you can look up each session id to find the user that file corresponds to, and give a list of online members.
hope this helps,
adam