Export (0) Print
Expand All

HttpCookie.Domain Property

Gets or sets the domain to associate the cookie with.

[Visual Basic]
Public Property Domain As String
public string Domain {get; set;}
public: __property String* get_Domain();
public: __property void set_Domain(String*);
public function get Domain() : String;
public function set Domain(String);

Property Value

The name of the domain to associate the cookie with. The default value is the current domain.


Setting the Domain attribute limits transmission of the cookie to clients requesting a resource from that domain.


The following example sets the cookie's domain.

[Visual Basic] 
MyCookie.Domain = "Microsoft.com"

MyCookie.Domain = "Microsoft.com";

MyCookie->Domain = S"Microsoft.com";

myCookie.Domain = "Microsoft.com"


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpCookie Class | HttpCookie Members | System.Web Namespace

© 2014 Microsoft