How check user online status in web site?
- by Milan Sanda Sri
how can i get know when user online and offline.
when one user log in to my site.
i set a script to change database table field of that user,
as a boolean to indicates users online states.
but my problem is if he/she leaved my site without clicking the log-out button,
then my script does not work and database show he/she as a online user.
please give me any sugestion to fix this. i have no idea what to do!
i check some answers on this topic,
but most of says asnwer lie this --
if last activity time is less than now+15 minutes
then user is online, offline otherwise.
but i have seen some social networking sites shows that we have gone offline, just we close the browser. how they do that ?