Track user existence

Hi all,

i am working on a program basically with individual user area and interfaces. The administrator need to see online users in his area. I was trying with setting up a flag in database while user logs in or out. But this wont work if the user closes the window. So i must find something to check frequently the existence of the users.

I heard of php sessions which can do frequent checks… CAn anybody give some details about it?

What would be the best possible way to do this? Can anyone refer me some articles which describing this?

All the helps would be greatly appreciated.
Thanks in Advance…