c# - Class instance being shared by multiple users -


i have web app hosted on azure shares messages among users table called message located in sql azure database. project contains class keep track of current user information called currentuser.cs. contains properties username, roomid, jointime, etc. i'm having difficulty understanding happens class when user logs in. thought every user have own instance of currentuser not accessible others. here's i'm seeing:

if usera logs in, able post messages , messages display username. when userb logs in, able post messages username. if usera posts message after userb has logged in, messages display userb's username. leads me believe usera's currentuser.cs file being overwritten when userb signs in. how can be? thought every time visited site, new instance of currentuser.cs exist. not case? of users share same currentuser class have it?

edit

i have constructor inside currentuser sets properties when app loads. never call currentuser user = new currentuser() or anything. question more whether or not each user has own version of currentuser.cs or not. under impression did not have create instance of currentuser because each visitor have own.

    static currentuser()     {         membershipuser membershipuser = membership.getuser();          _username = membershipuser.username;         _providerkey = (guid)membershipuser.provideruserkey;          userprofile profile = userprofilecontroller.getbyproviderkey(_providerkey);          _userid = profile.userid;         _roomid = profile.roomid;         _joinroomtime = datetime.now.touniversaltime();          displayedmessages = new list<message>();     } 

edit 2

my properties static class not. perhaps has it?


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -