I\'m to create a website for which I need to count the online users and show it on the home page all the time. I\'m not interested to apply ready-to-use modules for it. Here
You could use onUserExit jQuery plugin to call some server side code and abandon the session. Activate onUserExit on document ready :
And in EndSession.ashx abandon the session and server side Session_End will be called :
public void ProcessRequest(HttpContext context)
{
context.Session.Abandon();
context.Response.ContentType = "text/plain";
context.Response.Write("My session abandoned !");
}
note that this will not cover all cases (for example if user kills browser trough task manager).