ZennoLab Assemblies Documentation
Create(String,String,String,String,DateTime,Boolean,Boolean,Boolean) Method
Example 
ZennoLab.InterfacesLibrary.ProjectModel Namespace > ICookieContainer Interface > Create Method : Create(String,String,String,String,DateTime,Boolean,Boolean,Boolean) Method

Type: System.String

The host of cookie. For example "lessons.zennolab.com", ".zennolab.com", etc.

Type: System.String

The path of cookie.

Type: System.String

The name of cookie.

Type: System.String

The value of cookie.

Type: System.DateTime

The expiry date of cookie.

Type: System.Boolean

The secure flag of cookie.

Type: System.Boolean

The httpOnly flag of cookie.

Type: System.Boolean

The session flag of cookie.

Creates a new cookie item.
Syntax

Parameters

host

Type: System.String

The host of cookie. For example "lessons.zennolab.com", ".zennolab.com", etc.

path

Type: System.String

The path of cookie.

name

Type: System.String

The name of cookie.

value

Type: System.String

The value of cookie.

expiry

Type: System.DateTime

The expiry date of cookie.

isSecure

Type: System.Boolean

The secure flag of cookie.

isHttpOnly

Type: System.Boolean

The httpOnly flag of cookie.

isSession

Type: System.Boolean

The session flag of cookie.

Return Value

Type: ICookieItem

New cookie item object.

Example
The following code example demonstrates the Create method.
// create new cookie item
var item = project.Profile.CookieContainer.Create(".zennolab.com", "/", "asd", "123", DateTime.Now.AddYears(1), false, false, false);
// add item to container
project.Profile.CookieContainer.Add(item);
Requirements

Target Platforms: Desktop: Windows XP SP3 and older. Server: Windows Server 2003 and older.

See Also

Reference

ICookieContainer Interface
ICookieContainer Members
Overload List