Is there a way in PHP to get informations about all sessions of users connected on my server ?
For example :
- User 1 logged in to my server with user info : login = "user1" and corpId= "test1"
- User 2 logged in to my server with user info : login = "user 2" and corpId = "test2"
Each time a user is logged in, user info's are stored into $_SESSION .
Problem to solve :
When a user calls login API, I would like to be able to check if exist (or not) a session where a user is connected with the same corpId.
Test Example :
User 3 (corpId="test3") calls login API. Result = SUCCESS
User 4 (corpId="test2") calls login API. Result = FAILED
(cause="ALREADY_EXISTING_SESSION)