To my knowledge, there isn't a clean way to obtain this from a 3rd party check. For example, if you were running in the user session, you could see the cookies perhaps and glean their log in state from there or a call to the API, such as /people/@me
If you are running via an admin account, then the best option you have is to use WebHooks ...
and notify your service when a user logs in ... and then you have a quick index you can query. Determining when a user logs out though is difficult, so you may need to create an estimated time window from login to determine "still logged in".
Hope that helps.