Hello Marc,
I don't sure, but I think one way can be to lock a record in a table (dbf) users while the user is logged, when the user logout, unlock the record, I think (no sure) when client lost the conection, the record is unlocked automatlicaly, you can test
saludos
Marcelo