You are on the right track but left out an important flag. You need to also store the time() on each page click, then you can have another script to update the table and mark users as logged out after a given amount of time has passed say 20 minutes. That way you do not rely on someone logging out.
good luck
|