This documentation is archived and is not being maintained.

Cookie Constructor (String, String, String)

.NET Framework 1.1

Initializes a new instance of the Cookie class with a specified Name, Value, and Path.

[Visual Basic]
Public Sub New( _
   ByVal name As String, _
   ByVal value As String, _
   ByVal path As String _
)
[C#]
public Cookie(
   string name,
 string value,
 string path
);
[C++]
public: Cookie(
   String* name,
 String* value,
 String* path
);
[JScript]
public function Cookie(
   name : String,
 value : String,
 path : String
);

Parameters

name
The name of a Cookie. The following characters must not be used inside name: equal sign, semicolon, comma, newline (\n), return (\r), tab (\t). The dollarsign character cannot be the first character.
value
The value of a Cookie. The following characters must not be used inside value: semicolon, comma.
path
The subset of URIs on the origin server to which this Cookie applies. The default value is "/".

Remarks

The default for the path parameter uses the empty string ("") .

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Cookie Class | Cookie Members | System.Net Namespace | Cookie Constructor Overload List | CookieCollection | CookieContainer | CookieException

Show: