Okay, I know there are squillions of topics on user tracking, but I couldn't find any doing exactly what I want.
I have a database table containing users for my site. When they log in, I use all the standard session tricks to track them. This all works fine. However, I would like to have a page that lists just currently logged on users.
So, I initially thought of setting a flag in my users table when someone logs on. This would work fine, however the problem is knowing when they have logged off. If they log off correctly, fine, but if they just shut the browser down, okay, the cookie will be destroyed, but the server will never get told to update the database flag.
Has anyone got any ideas for solving this? I could just time out the flag, but I was hoping for a better solution.
If anyone knows of any good articles/books containing general user tracking solutions that'd be good too...