v2026.6.4
All Bundles
Bundle Shared networking types used across all HTTP libraries: Url (parsing and construction), Response (status code, headers, body), Cookie, and WebDownloader for streaming downloads. Compile with -lib net.

Cookie

HTTP cookie

Operations

AddAttrib #

Adds a cookie attribute

method : public : AddAttrib(name:String) ~ Bool

Parameters

NameTypeDescription
nameStringattribute name

Return

TypeDescription
Booltrue if added, false otherwise

AddAttrib #

Adds a cookie attribute

method : public : AddAttrib(name:String, value:String) ~ Bool

Parameters

NameTypeDescription
nameStringattribute name
valueStringattribute value

Return

TypeDescription
Booltrue if added, false otherwise

Example

cookie := Web.HTTP.Cookie->New("id", "42");
cookie->AddAttrib("Path", "/");
cookie->AddAttrib("HttpOnly", Nil);
cookie->ToString()->PrintLine();  # id=42; Path=/; HttpOnly

Expire #

Sets the cookie to expire

method : public : Expire() ~ Nil

GetAttrib #

Get cookie attribute

method : public : GetAttrib(name:String) ~ String

Parameters

NameTypeDescription
nameStringattribute name

Return

TypeDescription
Stringcookie attribute value

GetName #

Get cookie name

method : public : GetName() ~ String

Return

TypeDescription
Stringcookie name

GetValue #

Get cookie value

method : public : GetValue() ~ String

Return

TypeDescription
Stringcookie value

New # constructor

Constructor

New(name:String, value:String, is_debug:Bool)

Parameters

NameTypeDescription
nameStringcookie name
valueStringcookie value
is_debugBooltrue to display debug information

Example

cookie := Web.HTTP.Cookie->New("session", "abc123", false);
cookie->GetName()->PrintLine();   # session
cookie->GetValue()->PrintLine();  # abc123
cookie->ToString()->PrintLine();  # session=abc123

New # constructor

Constructor

New(name:String, value:String)

Parameters

NameTypeDescription
nameStringcookie name
valueStringcookie value

New # constructor

Constructor

New(cookie_str:String)

Parameters

NameTypeDescription
cookie_strStringcookie string

New # constructor

Constructor

New(cookie_str:String, is_debug:Bool)

Parameters

NameTypeDescription
cookie_strStringcookie string
is_debugBooltrue to display debug information

RemoveAttrib #

Removes an attribute

method : public : RemoveAttrib(name:String) ~ Bool

Parameters

NameTypeDescription
nameStringattribute name

Return

TypeDescription
Booltrue if added, false otherwise

SetExpiration #

Sets the cookie to expiration date

method : public : SetExpiration(expires:System.Time.Date) ~ Bool

Parameters

NameTypeDescription
expiresDateexpiration date

SetName #

Set cookie name

method : public : SetName(name:String) ~ Nil

Parameters

NameTypeDescription
nameStringcookie name

SetValue #

Set cookie value

method : public : SetValue(value:String) ~ Nil

Parameters

NameTypeDescription
valueStringcookie value

ToShortString #

Formats a cookie name and value

method : public : ToShortString() ~ String

Return

TypeDescription
Stringstring formatted cookie name and value

ToString #

Formats a cookie into a string

method : public : ToString() ~ String

Return

TypeDescription
Stringstring formatted cookie