Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi am yogesh, i just joined this community and getting great help. thanks to all of you. can someone explain me with example that when two or more users are logged in at the same time, how to maintain their sessions. So that to avoid any conflicts.
please explain me with complete example of multiusers. i am using c# with asp.net THANKS IN ADVANCE....
Posted

1 solution

The Page class has a property called Session that is an instance of the HttpSessionState class.

You can use this object to store information specific to the currently logged in user. On a high level, each logged in user has a separate instance of this object, so you can use something like this:

To store information to session"
C#
Session["UserName"] = txtUserName.Text;


To read session information:
C#
string userName = Session["UserName"].ToString();


This[^] article will get you started on using sessions.
 
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