Export (0) Print
Expand All

HttpCookie.Domain Property

Gets or sets the domain to associate the cookie with.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public string Domain { get; set; }
/** @property */
public String get_Domain ()

/** @property */
public void set_Domain (String value)

public function get Domain () : String

public function set Domain (value : 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 code example sets the cookie's domain.

MyCookie.Domain = "Microsoft.com";
    

myCookie.set_Domain("Microsoft.com");

myCookie.Domain = "Microsoft.com"
    

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft