WebService.Session Property

 

Gets the HttpSessionState instance for the current request.

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

[BrowsableAttribute(false)]
public HttpSessionState Session {
	[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, 
		Level = AspNetHostingPermissionLevel.Minimal)]
	get;
}

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
Show: