Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Cookie Constructor (String, String, String)

Cookie Constructor (String, String, String)

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

Namespace: System.Net
Assembly: System (in system.dll)

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
)

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 dollar sign 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 "/".

Exception typeCondition

CookieException

The name parameter is a null reference (Nothing in Visual Basic).

-or-

The name parameter is of zero length.

-or-

The name parameter contains an invalid character.

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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2015 Microsoft