且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

检查用户是否在PHP中关闭了页面?

更新时间:2023-11-29 10:13:28

抱歉,没有可靠的方法,这就是HTTP的构建方式 - 它是一种拉协议。
我能想到的唯一解决方案是有效和登录的客户端必须在很短的时间间隔内查询服务器。如果他们不这样做,他们就会退出。

Sorry, there is no reliable way of doing this, that's the way HTTP was built - it's a "pull" protocol. The only solution I can think of is that "valid" and logged in clients must query the server in a very small interval. If they don't, they're logged out.