ZennoLab Assemblies Documentation
Create(String,String,String,String,DateTime,Boolean,Boolean,Boolean,String,String) Method
Example 
ZennoLab.InterfacesLibrary.ProjectModel Namespace > ICookieContainer Interface > Create Method : Create(String,String,String,String,DateTime,Boolean,Boolean,Boolean,String,String) 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.

Type: System.String

The sameSite of cookie. The sameSite may take values "Strict", "Lax", "None" and "Unspecified". Default value is "Unspecified".

Type: System.String

The priority of cookie. The priority may take values "Low", "Medium", "High". Default value is "Medium".

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.

sameSite

Type: System.String

The sameSite of cookie. The sameSite may take values "Strict", "Lax", "None" and "Unspecified". Default value is "Unspecified".

priority

Type: System.String

The priority of cookie. The priority may take values "Low", "Medium", "High". Default value is "Medium".

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, "Strict", "Medium");
// 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