I have a ASP.NET MVC web application that needs to notify the server when a user leaves. To do so, I make an Ajax call posting a string to the server.
Currently, I'm making the call on the window.onbeforeunload event, but to do more than show the user a message, this event is very unreliable.
The other ways I come up to do this was by using SignalR to do a ping-pong request or to control something (session?) on the server side.
What's the best approach to make the server know when a user leave the application?