Export (0) Print
Expand All

Cookie Constructor (String, String, String, String)

.NET Framework 1.1

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

[Visual Basic]
Public Sub New( _
   ByVal name As String, _
   ByVal value As String, _
   ByVal path As String, _
   ByVal domain As String _
public Cookie(
   string name,
 string value,
 string path,
 string domain
public: Cookie(
   String* name,
 String* value,
 String* path,
 String* domain
public function Cookie(
   name : String,
 value : String,
 path : String,
 domain : 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 object. 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 optional internet domain for which this Cookie is valid. The default value is the host this Cookie has been received from.


The default for the domain and path parameters 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

© 2014 Microsoft