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 _
public Cookie(
   string name,
 string value,
 string path
public: Cookie(
   String* name,
 String* value,
 String* path
public function Cookie(
   name : String,
 value : String,
 path : String


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.
The value of a Cookie. The following characters must not be used inside value: semicolon, comma.
The subset of URIs on the origin server to which this Cookie applies. The default value is "/".


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


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