HttpCookiesSection.Domain Property


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

This API supports the product infrastructure and is not intended to be used directly from your code.

Gets or sets the cookie domain name.

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

[ConfigurationPropertyAttribute("domain", DefaultValue = "")]
public string Domain { get; set; }

Property Value

Type: System.String

The cookie domain name.

The following code example shows how to use the Domain property.

// Get the current Domain.
string domainValue = 

// Set the Domain.
httpCookiesSection.Domain = 

.NET Framework
Available since 2.0
Return to top