I have one idea, When user login into the sides , store the UserID in a database and this are the user who are presently online. When users logoff from the sites remove the user id .
This is one of the simple approach that you can developed.
Yeah m getting ur point but my confusion is about the page refresh how would I find the data after each refresh of a page.bacause current online and offline users can be changed in every second.So I will have to fetch data of every second.
Hmm, Don’t go for hitting database on every page refresh. That will hit badly on your performance. You caching. Add Dependency with caching data and database that when ever data will changed on a database your cache will be update. You just access cache data.
Use a DB in which save every user login/logout detail with coresponding userids.It can done by Session_start and Session_end mathod in asax file.For the count ,take a application variable,update it every time on user's when login/logout.or simply get the same from DB.
As I am seeing you are a new members of CP , First of all Welcome to CP .
Before Post in any of the CP Forum, First Please Read the Posting guide line .
Did you every try to find out in Google. Have a look what can be the modules of CRM[^]