Click here to Skip to main content
16,019,873 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have an ASP.net application where users can chat with online users. There is no membership implemented here, when user log in we set the status as online.
The problem is if user's are idle since long time or they close their browser we need to change their status.
How can we don that?
Posted
Comments
Thanks7872 14-Apr-15 2:02am    
This question can't be answered because we don't know how you set status,what do you mean by 'idle since long time'. Define 'long time' and measure it. After that, update status to idle just like you set it to online.
nikhil choudhry 14-Apr-15 2:12am    
Consider any .net application, a user logs in and application update his status as online in database. Now he doesn't do anything and keep browser open for a long time or close the browser. How will you make his status as offline?

1 solution

Basically the only 'connection' between an open page in the browser and server, served it is the session at the server and some id the browser manages internally to be able to re-connect to that session...That session at the server there is a life-span (20 minutes by default in IIS) that will comes to and end with an event - Session_End - in your global.asax...
https://msdn.microsoft.com/en-us/library/ms178583%28v=vs.140%29.aspx[^]
Setting the status to offline at that event may give you a solution...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900