Use database control to save user status id, so that you can only log in on one machine
What I mean by single sign-on here is to log in in one place, and you don’t need to log in to other systems
Just like 12306 logged in on the computer and logged out on the mobile phone.
Use database control to save user status id, so that you can only log in on one machine
What I mean by single sign-on here is to log in in one place, and you don’t need to log in to other systems
Just like 12306 logged in on the computer and logged out on the mobile phone.
Thank you for the invitation. Unique login restriction. Each time the user logs in, it is set to generate a unique ID or token. It is best to limit it by time and always keep it up-to-date and valid.
The login operation generates a login token and saves it in the database and deletes the old token data. This ensures that there is only one Client login account. If the login token is invalid, let it log out
According to session_id, record the latest session_id, the old one is invalid
The idea is to use unique login restrictions and message push to achieve real-time logout. If I do it, I will save a copy of the temporary token in memcache and a copy of the local website. When logging in from a new location, I will update the token on memcache and check whether the local token of the website is consistent with the one in memcache. If it is inconsistent, It's the old login point, and then just delete it.
You didn’t ask clearly
Do you want to log out when the pc is logged into the mobile phone, and log out when the mobile phone is logged into the pc. Or, once you log in on the PC, you will log out when the mobile phone performs the next operation. Once you log in on the mobile phone, you will log out when the PC performs the next session. Of the two, one is active and the other is passive. If it is active, then the answer above can be used. If it is passive:
The mobile terminal can establish a service for background service
The PC terminal can use socket communication. Or it can be completed by ajax scheduled request