How to maintain the correct logged in users count in asp.net application
Hi All,Today I met a interview question like "Consider a Asp.Net appreciation page, in the top of the page u have a label like Logged in users Count" So u need to show correct logged in users count.
I replied like i will set a flag in userstable in Db and show the result based on that flag count when the page load.
He said k ..If a user properly logged out means u will update the flag in userstable in Db,the question is if users close the browsers tab or the user close the browser means how u will update the users table flag.
Finally he said the answer we can done by using global.asax application close event.
Now I checked,I m having a sample applciation with global.asax file.After i run the application ,I close the tab and also tried with close the tab.But the "Application_End" event not firing.
So how to solve that the above mentioned loggedin users count problem.....
Thanks in Advance :)