want to detect browser close event?

后端 未结 3 1736
渐次进展
渐次进展 2021-01-21 06:40

I am working on any application in which i need to detect that whether user close the tab or browser so I can disconnect the user from other user basically its an chat applicati

3条回答
  •  盖世英雄少女心
    2021-01-21 07:29

    Why not have the client's periodically 'ping' the server to let it know that they are still there, and if a user misses say 3 pings then it will be marked as logged off?

提交回复
热议问题