So I have an application that requires a one-person-at-a-time operation. So if one person is signed in, nobody else can take control unless he/she closes the browser.
So far, that works fine. But.... if said person just simply walks away, or switches WiFi without closing the browser (mobile device) then the web session becomes "dead".
I tried simply adding a timer in the Page that uses the websocket to run some code on the client side that acts like a ping, but if the page goes "dead" the timer just doesn't work anymore. I was hoping it would force/detect the dead websocket, and run websocket_disconnected, but it doesnt. the code just vaporizes.
so the webapp simply sits there and does nothing. But since the "websocket disconnected" event never fires on the dead page, it wont clear its session out to allow another to connect.
I need an easier way to track a dead page.
any ideas? thanks.
So far, that works fine. But.... if said person just simply walks away, or switches WiFi without closing the browser (mobile device) then the web session becomes "dead".
I tried simply adding a timer in the Page that uses the websocket to run some code on the client side that acts like a ping, but if the page goes "dead" the timer just doesn't work anymore. I was hoping it would force/detect the dead websocket, and run websocket_disconnected, but it doesnt. the code just vaporizes.
so the webapp simply sits there and does nothing. But since the "websocket disconnected" event never fires on the dead page, it wont clear its session out to allow another to connect.
I need an easier way to track a dead page.
any ideas? thanks.