Hj. I make a counter for my website .It's very plain!!.And when i run website on localhost by much browser ,So it's right.But when i turn off a browser and refresh browser remain .It's not right and i think this is problem from Session_End in global.asax.This is my code .Hope everyone help me about that!
protected void Application_Start(object sender, EventArgs e)
{
Application["person_online"] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{
Application.Lock();
Application["person_online"] = Convert.ToInt32(Application["person_online"]) + 1;
Application.UnLock();
}
protected void Session_End(object sender, EventArgs e)
{
Application.Lock();
Application["person_online"] =Convert.ToInt32(Application["person_online"])-1;
Application.UnLock();
}
Loading

Dipal ChoksiRank #199 · 12K reputationPosted Oct 31, 2011, 6:57 PM EDT
viet vo quoc114 reputationPosted Oct 31, 2011, 7:31 PM EDT
I hope have much explanation from you or someone know it.Thanks!!