such as title:
my own logic:
1. Add a field is_online to the user table (whether you have logged in 0 but not logged in 1)
2. Determine whether this field is 1 when logging in, and update this field to 0
if the user exits abnormally (closing the browser, etc.), it will be impossible to update the is_online field
at present, I have come up with a method: but I don"t fully understand
.is to determine whether the session_id in the database exists in the server when session_id is stored in the database and logged in?
how to do this, please ask