How to check another user is logged in?
There aren't any functions in Drupal that I am aware of. You'll need to query the database.

$time_active = db_query("SELECT timestamp FROM {sessions} WHERE uid = :uid ORDER BY timestamp DESC LIMIT 1", array(":uid" =&gt; $uid))-&gt;fetchField();


That will fetch the last time that the user was active if they have a current session open.