How to check whether a user (not current User) has active logged in session or not

The AuthSession object keeps each non-guest user session in your organization. Here is full detail of object: Check the size of auth if it’s greater than zero and IsCurrent is true then session is active otherwise not.