hi,
when you close the browser or the server the client actually disconnects, that's why the onStatusChange is called.

also STALLED is not the same as DISCONNECTED as the former can just be caused by a delay in the network

you may want to also listen to the onEngineLost event as a lost engine also means "no connection available"

finally I see that you want to reload the page when your client disconnects. May I ask you why? Are you experiencing any problem that lead you to take this approach?