Killing session value in Browser Close
<p>I am working in C#.Net. I want to kill the session values when the browser is closed. (i.e) In my application, i want to display online visitors count. If the user clicks logout button means, it works fine. rather than if he close the browser, the session value not cleared.</p>

<p>if the browser close is done, the session value should be killed.... </p>

<p>My Global.ascx code...</p>

<pre><code>void Application_Start(object sender, EventArgs e)
{
    // Code that runs on application startup      
    Application["OnlineUsers"] = 0;
}

void Application_End(object sender, EventArgs e)
{
    //  Code that runs on application shutdown
}

void Application_Error(object sender, EventArgs e)
{
    // Code that runs when an unhandled error occurs
}

void Session_Start(object sender, EventArgs e)
{
    Application.Lock();
    Application["OnlineUsers"] = (int)Application["OnlineUsers"] + 1;
    Application.UnLock();
}

void Session_End(object sender, EventArgs e)
{
    Application.Lock();
    Application["OnlineUsers"] = (int)Application["OnlineUsers"] - 1;
    Application.UnLock();
}
</code></pre>

<p>My Home.aspx code...</p>

<pre><code> Visitors online: &lt;%= Application["OnlineUsers"].ToString() %&gt;
</code></pre>

<p>If i run my application in IE, the online count will be 1. If i runs in Firefox, the online count should be incresed to 2. If i close the Firefox browser, the count in IE should be changed to 1.</p>

<p>This is my Requirement....</p>
