Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpContext.Current.Session vs Context.Session

Tags:

c#

asp.net

Are they the same thing? Or are they different?

I'd read this SO post and this but they are comparing HttpContext.Current.Session and Session not Context.Session. What am I missing/misunderstanding?

like image 531
koshikei Avatar asked Jan 08 '13 03:01

koshikei


1 Answers

HttpApplication's Session property exhibits different behaviour than does that of the proporty HttpContext.Current.Session. They will both return a reference to the same HttpSessionState instance if one is available. They differ in what they do when there is no instance of HttpSessionState available for the current request.

On this answer you have the complete response:

Difference between Session and HttpContext.Current.Session

like image 119
SandroG Avatar answered Nov 03 '22 19:11

SandroG