System.Web Namespace HttpCookie Class
Sets or retrieves the domain to associate the cookie with.
[ VB ]
Public Property Domain As String
[ C# ]
public string Domain {get; set;}
[ C++ ]
public: __property String* get_Domain ( );
public: __property void set_Domain ( String* );
[ JScript ]
public function get Domain ( ) : String;
public function set Domain ( String );
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.
[ VB ]
myCookie.Domain = "Microsoft.com"
[ C# ]
myCookie.Domain = "Microsoft.com";
[ JScript ]
myCookie.Domain = "Microsoft.com"
HttpCookie Members