Click here to Skip to main content
15,893,337 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to get all login user list at welcome user page .So each user can see the login user list.For that I have created a session ["username"] in login page and after that i want to use that sesion in session start method of asax and i want to retrieve all the login users and store it into application scope and i also want to remove and insert users on login and logout page.so i am not getting a way how would i do that .because i am new to the concept called global asax file thanks
Posted
Comments
Srinivas Kalabarigi 9-Aug-13 8:41am    
How many users are you talking about?
virusstorm 9-Aug-13 9:58am    
Session variables are only accessible within the context of the session. In other words user X can't access session data for user Y. Using the global.asax file is a good starting point, but you will need the Application State to track all of the users logged in.

You could track who's logged in by saving into a data file or updating a User table in a database which has a column used as a flag. Then use a query such as 'select Names from Users where Login=1'.
 
Share this answer
 
Comments
Dharmendra Tiwari 22-Aug-13 0:28am    
thanks Jon "Greg"ory Rothlander and BacchusBeale ...I found your solution very usefull
There may be better ways, but if nothing else you should be able to hold this in a global.asax, a singleton class. Just create a string list with the user name, then append the users to your list and use the lists count for your total number of users. But I suspect there are standard approaches to doing such as thing as this. But if you cannot find a good solution, you could build it out yourself pretty easily.
 
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