Jadpo is experimental and not ready for production. These docs follow the compiler's main branch as of 5 Nov 2026. What's built · Install 0.3.0
jadpo
ReferenceWeb and network

LanguageValues and typesStandard typesWeb and network

Cookie

On this page

A cookie as a server sets it: SID=31d4d96e; Path=/; Secure; HttpOnly.

Use it to read or record cookies from an outside service. Your own app's sign-in cookies are handled for you, so you don't set them.

Shape

One value, held as text in one set form, with no parts: __Host-SID=31d4d96e407aad42; Max-Age=3600; Path=/; Secure; SameSite=None.

Example

example
Cookie("SID=31d4d96e; Path=/; Secure; HttpOnly")

Cookie(raw) checks the text, and text that isn't one breaks the format rule.

text.parse(raw, as: Cookie) reads one from text that comes from outside. Text that isn't one at all fails malformed, such as SID=31d4 d96e, SID=31d4d96e; secure or SID=31d4d96e; HttpOnly; Secure.

Good to know

  • Attributes are in the standard's order and spelling, so secure is refused.
  • == tells you whether two are the same. < and list.sort_by don't take it.
  • A field that holds one counts as personal data (online), so you don't mark it yourself.

In JSON

A string, in a request, a response or json.write:

json
"lang=en-GB""SID=31d4d96e407aad42; Path=/; Secure; HttpOnly; SameSite=Lax""lang=en-US; Expires=Wed, 21 Oct 2026 07:28:00 GMT; Domain=example.com"

Details

Text form, storage, how it is shown, and operations

Cookie is in the group Web and network, and has been in Jadpo since 0.1.0.

Text form

text.from writes one standard text form, the same form text.parse reads back: lang=en-GB, SID=31d4d96e407aad42; Path=/; Secure; HttpOnly; SameSite=Lax and lang=en-US; Expires=Wed, 21 Oct 2026 07:28:00 GMT; Domain=example.com.

How it is stored

It is stored in one column named for the field, of type text. lang=en-US; Expires=Wed, 21 Oct 2026 07:28:00 GMT; Domain=example.com is stored as 'lang=en-US; Expires=Wed, 21 Oct 2026 07:28:00 GMT; Domain=example.com'.

How it is shown to people

text.format(value, locale:) shows it to people in their locale.

With locale: Locale.en_gb:

Value Shown
lang=en-GB lang=en-GB
SID=31d4d96e407aad42; Path=/; Secure; HttpOnly; SameSite=Lax SID=31d4d96e407aad42; Path=/; Secure; HttpOnly; SameSite=Lax
lang=en-US; Expires=Wed, 21 Oct 2026 07:28:00 GMT; Domain=example.com lang=en-US; Expires=Wed, 21 Oct 2026 07:28:00 GMT; Domain=example.com
__Host-SID=31d4d96e407aad42; Max-Age=3600; Path=/; Secure; SameSite=None __Host-SID=31d4d96e407aad42; Max-Age=3600; Path=/; Secure; SameSite=None

Operations

It also takes text.parse, text.from, text.format, json.read, json.write and ==. How every standard type behaves says how they work.

Markdown for agents: /docs/types/type-cookie.md.Built from Jadpo main at aee2e8f.