The domain for which the cookie is valid.
The current value of the domain. The default value is null.
This is an optional parameter for cookies, and by default the value of this property is null.
- The value for the Path attribute is not a prefix of the request- URI.
- The value for the Domain attribute contains no embedded dots or does not start with a dot.
- The value for the request-host does not domain-match the Domain attribute.
- The request-host is a FQDN (not IP address) and has the form HD, where D is the value of the Domain attribute, and H is a string that contains one or more dots.
Examples:
- A Set-Cookie from request-host y.x.foo.com for Domain=.foo.com would be rejected, because H is y.x and contains a dot.
- A Set-Cookie from request-host x.foo.com for Domain=.foo.com would be accepted.
- A Set-Cookie with Domain=.com or Domain=.com., will always be rejected, because there is no embedded dot.
- A Set-Cookie with Domain=ajax.com will be rejected because the value for Domain does not begin with a dot.
Namespace: System.Web
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0