Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HttpContext::Session Property

 

Gets the HttpSessionState object for the current HTTP request.

Namespace:   System.Web
Assembly:  System.Web (in System.Web.dll)

public:
property HttpSessionState^ Session {
	HttpSessionState^ get();
}

Property Value

Type: System.Web.SessionState::HttpSessionState^

The HttpSessionState object for the current HTTP request.

The Session property provides programmatic access to the properties and methods of the HttpSessionState class.

In order to use session state you have to enable it. For information about how to enable session state, see Configuring Session State in ASP.NET Session State Overview.

For information about how to save values in session state, see How to: Save Values in Session State. For information about how to read values from session state, see How to: Read Values from Session State.

The following examples show how to save values in session state and how to read values from session state.

These examples require:

  • An ASP.NET application that has session state enabled.

  • A Web Forms page class that has access to the Page::Session property, or any class that has access to the HttpContext::Current property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top
Show:
© 2017 Microsoft