well if you check from a text file then have your script check to see if they are online then if not just delete there name. or you can just delete there name after a certain amount of time out of the text file.

like this site. I never log out but the site shows that I am not here as I ain't, but when I am here it doesn't require me to log in again. that is because it goes off my cookie.

so if a certain amount of time have the scripts check the cookies to see who is here or not then if not then delete their name off the list.