Detecting Browser exit in PHP

后端 未结 4 1578
太阳男子
太阳男子 2020-12-10 09:09

I have looked at a few topics (here & google) regarding detecting browser exit in php and im not really any clearer on how to do so.

I tried the register_s

4条回答
  •  天涯浪人
    2020-12-10 09:35

    One solution that is at least fool resistant is to send a heartbeat to the server using Javascript and Ajax, then assuming that the browser window has been closed when the signal stops pulsing.

    Another would be to use web sockets to maintain a constant connection until the browser window closes.

    In any case it would take quite a bit of work from your part to set it up

提交回复
热议问题