I know that since HTTP is a stateless protocol, this cannot be detected directly. What I need to know is how to achieve this indirectly.
I am making a turn based game in PHP in which two users play over the internet. Need to detect disconnections of any user so that server can end the game and do end-of-the game processes.
I am tracking the last_activity_time of a user based on session, but don't know how to use this to detect a disconnection. Have seen some similar games use this, I can write my code myself once I get the logic. Any help would be much appreciated.