Hinauna,
For checking user is logged in or not you need to keep the information in database.
Save the details of last login and logout date time in database.
At the time of login you need to update the login time.
And you need to use the Session_End event in global.asax to update the logout datetime.
Form the login and logout datetime you can check the user status for active or inactive.
Refer below link for details.