Path Property

HttpCookie.Path Property

Gets or sets the virtual path to transmit with the current cookie.

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

public string Path { get; set; }
/** @property */
public String get_Path ()

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

public function get Path () : String

public function set Path (value : String)

Not applicable.

Property Value

The virtual path to transmit with the cookie. The default is the path of the current request.

The Path property extends the Domain property to completely describe the specific URL to which the cookie applies. For example, in the URL http:/www.microsoft.com/asp, the domain is www.microsoft.com and the path is /asp.

The following code example sets the Path property of a new cookie.

MyCookie.Path = "/asp";
 

myCookie.set_Path("/asp");

myCookie.Path = "/asp"
 

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

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2016 Microsoft