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
[C#]
public string Path {get; set;}
[C++]
public: __property String* get_Path();
public: __property void set_Path(String*);
[JScript]
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.

Remarks

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.

Example

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

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

[C#] 
MyCookie.Path = "/asp";
 

[C++] 
MyCookie->Path = S"/asp";
 

[JScript] 
myCookie.Path = "/asp"
 

Requirements

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

See Also

HttpCookie Class | HttpCookie Members | System.Web Namespace

Show:
© 2015 Microsoft