System.Web Namespace HttpCookie Class
Creates, names, and assigns a value to a new cookie.
[ VB ]
Public Sub New ( _
ByVal name As String, _
ByVal value As String _
)
[ C# ]
public HttpCookie (
string name,
string value
);
[ C++ ]
public: HttpCookie (
String* name,
String* value
);
[ JScript ]
public function HttpCookie (
name : String,
value : String
);
- name
- The name of the new cookie.
- value
- The value of the new cookie.
The following example creates, names, and sets the value of a new cookie.
[ VB ]
Dim myCookie As New HttpCookie ( "LastVisit", CStr ( DateTime.Now ( ) ) )
[ C# ]
HttpCookie myCookie = new HttpCookie ( "LastVisit", DateTime.Now.ToString ( ) );
HttpCookie Members HttpCookie Constructor Overload List