This is done as the following:
UserA logs in with his session id('123') and it will be stored in the database.
Then, UserB logs in also using the same email and password of UserA from another PC,
and also store the session id('456') in the database
Now, Whenever UserA performs any action,
You then check the session_id() against the last one stored in the database('456'),
If they don't match then log both of them out.
public static isConcurrentSessionExists ( ) : boolean | ||
Résultat | boolean |