WebService.Session Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets the HttpSessionState instance for the current request.

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

public HttpSessionState Session {
		Level = AspNetHostingPermissionLevel.Minimal)]

Property Value

Type: System.Web.SessionState.HttpSessionState

An HttpSessionState representing the ASP.NET session state object for the current session.

The example below uses session state to determine how many times a particular session accesses the XML Web service method SessionHitCounter. In this example, the EnableSession property of the WebMethodAttribute is set to true in order to gain access to session state.

.NET Framework
Available since 1.1
Return to top