Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Domain Property
Collapse the table of content
Expand the table of content

HttpCookiesSection.Domain Property

This API supports the .NET Framework 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 = 
          httpCookiesSection.Domain;

      // Set the Domain.
      httpCookiesSection.Domain = 
          string.Empty;

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft