Well... I know that under Linux or Unix systems you can "guess" at if the user is connected by looking (at least this I think is the default) at the /tmp directory... there should be a file or files in there that say something like:
sess_ea548ec8eda8c46d1e613a045de4e6c0
or something like that. These are actuall tmp files where the session variables are stored. So you could check this and see if someone was connected (although they might have closed there browser or left the site but the session would still remain). You could check the /var/log/access.log file and see (might not be in a session though), or you could write a script that say accesses a database when the user logs in and some admin page or something that would tell if the user is logged in. All of these are shaky at best for the fact that the HTTP protocol is a connectionless protocol. That is HTTP will take a request send it to you and forget who sent it, so its kinda hard to be 100% sure someone is at that moment connected to you.
Hope that helps.