Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 17, 2011 03:06 PM by Outflank
Dec 16, 2011 03:34 PM|LINK
I am relatively new to ASP.NET so please forigve the nubie question!
I am using Session to store user data BUT I am seeing the following:
User1 logs in:
I set the Session["User"] = "user1"
User2 logs in:
I set Session["User"] = "user2"
I thought that Session was specific to the current session but it seems not to be since it seems I am altering the same Session var. I say this because after user2 logs in the Session var changes to Session["User"] = "user2" and anything user1 does is saved
for "user2"??? Certainly I am doing something wrong and maybe misunderstood how to use Session???
Thanks in advance
Dec 16, 2011 03:56 PM|LINK
No ... that should not be the case. That is the case for the Application or Cache objects.
Make sure that when you are testing this that you don't use the same browser / computer, because even though you may be logged on with a different account, the session may still be shared. Try testing from two seperate computers.
hope this helps,
Dec 16, 2011 09:35 PM|LINK
BINGO! sivilian. I was using the same browser on the same machine! Tested on 2 diff machines and it worked fine. Weeeeeeeeeeeew! That scared the fire out of me! Is there a way to safeguard against this behavior on the same machine?
Thanks a ton for you help!
Dec 16, 2011 11:26 PM|LINK
If you want to open different session in the same browser, at least in IE, you can go to the file menu and select New Session. This will open a new window in a new session
Dec 17, 2011 03:06 PM|LINK
Duh! I should know that! LOL!
You've been a great help!