I've been fiddling with a script like this and the main idea i had was a script in cron or that sleeps for a minute at a time and then reads a username/timestamp file or array/hash and logs people out if they haven't said anything.
You could always do this and add the onunload event for those
that support it and a logout button for those that will bother