Is
System.Web.HttpContext.Current.Session
the same as
System.Web.UI.Page.Session
?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
They do indeed refer to the same instance, but if you look at the methods in Reflector, you can see that they behave a bit differently (in ways that are not likely to matter in most applications):
Page.Sessionuses acached
HttpSessionStatereference.Pagemethod will throw ifsession state is not enabled, while
HttpSessionState.Sessionjustreturns whatever is in the
“AspSession” bucket of its
Itemscollection.