Agnes:
I setup a .dbf file that contains one record for each user that logs in. When the user starts the application a new record is created and locked for the duration of the user's session. Once the user logs out the record is unlocked. If the user's session terminates abnormally the server will release the lock. In my application I simply count the number of locked records and compare the count to the license limit. There is some additional code that cleans up the file when the opportunity arises and removes old records.
Dunno if my explanation is clear. FWIW, been using this approach for 15 or more years without a problem. The part I like is the OS automatically removes the user from the "active" list by releasing outstanding record locks when their session ends, whether through normal program termination or a program failure.
Scott
Scott Ramey
BDS Software