Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use a Session as following:
Session["UserID"]

in the login page,I set it to the use to store the user id,and the value is 2(int).
but when I turn to other one page main.aspx,the value I get is 1(int).I do not make any change during the process by myself.I can not understand why this bug happening?
Posted
Updated 20-Apr-11 7:35am
v2

change the session name, Use MyUserID or any things instead of UserID.
 
Share this answer
 
Values in sessions are stored as objects. So you must be doing a cast somewhere in your code.
See ASP.NET Session Helper (Scope, Categories) - just to give you a brief idea.
 
Share this answer
 
v2

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