This documentation is archived and is not being maintained.

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)

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 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
Show: