DisconnectReason when user closes the browser

BesoC ✭✭
edited August 2013 in Flash (deprecated)

Suppose Photon AS3 client is running inside browser's tab and user just closes the browser. I noticed that in this case Server receives ClientDiconnect as DisconnectReason in OnDisconnect() event. I want to be able to detect situations when user just closes client regardles whether he logs out or closes the browser. Can i rely on DisconnectReason?


  • Closing browser with connected client triggers OnDisconnect with ClientDisconnect reason on server. The same happens when client disconnect() called (if you mean that by log out). In both cases socket is closed from client side.