Tracking Client Status

I’m trying to track a client with whether it has someone logged in, open but no one logged in, etc. I’ve got it working for the most part, but I’ve hit a little bit of a road block with the lock screen function. I have a script on a component to write to a db table that the corresponding client is currently locked, this works fine. The problem is how do I get it to show as logged out, or logged in when coming back from the lock screen. The user can unlock or logout from the lock screen so I’m trying to figure out how to document the action performed. When someone logs in, I get the status to update with a script on the always present navigation tab using if event.propertyName == 'componentRunning': I tried window scripting with internalFrameActivated, and onWindowOpened, but these either didn’t run from a lock screen, switch user function, or it wrote over another event. Note that the client will, for the most part, always be open the user will log out but not close the client.

Not sure, but is a lock screen action logged by the audit log?