I will use java for this. The mechanic will be simple, the app itself will start on the windows start and get a random session id. In the database will add the log of startup with the assigned id.
Relevant Skills and Experience
The database will update every given seconds with the latest timestamp, when the user will logout, you will see in the database the start timestamp and latest update timestamp which will be the end