Export (0) Print
Expand All

HttpCookie.Path Property

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

[Visual Basic]
Public Property Path As String
public string Path {get; set;}
public: __property String* get_Path();
public: __property void set_Path(String*);
public function get Path() : String;
public function set Path(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 that the cookie applies to. For example, in the URL http:/www.microsoft.com/asp, the domain is www.microsoft.com and the path is/asp.


The following example sets the path property of a new cookie.

[Visual Basic] 
MyCookie.Path = "/asp"

MyCookie.Path = "/asp";

MyCookie->Path = S"/asp";

myCookie.Path = "/asp"


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

See Also

HttpCookie Class | HttpCookie Members | System.Web Namespace

© 2015 Microsoft