How to know Active sessions in Drupal?
There exists a module for that called Active Sessions

Active Session is a module that allows a user to see if there is more than one session opened for their user and allows them (with permissions) to end other sessions belonging to their user. There is also an interface where a user with permissions can view all active sessions and close them.
Active Session creates a block that, by default, is placed in the footer of the page for users with 'view own sessions' or 'view all sessions' permissions to see and get more details about the sessions.

Images from module page