views:

130

answers:

1

HttpContext.Current returns an IPrincipal object that represents security context of the current user. I understand principal object combines the identity of a user with other information, such as roles, privileges etc.

But why do we say it represents the current context of the user? Why not just say it represent a user? Is there a particular reason why we use the term current context?

+6  A: 

The HttpContext object contains access to many other helpful items, such as the Server object that provides the ability to map paths to physical and other paths. There is much more than user information.

It is the true Context of the HTTP request as it currently stands. This has request, response, and other objects available as well.

Mitchel Sellers
"Context of the HTTP session" - more accurately, the context of the current HTTP request.
Joe
@joe - Fixed - great point
Mitchel Sellers
thank you all for your help
SourceC