---
id: "http_cookie"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["internet", "secrets"]
langs: ["common"]
quality: 88
url: "https://registry.apicrafter.io/datatype/http_cookie"
---

# HTTP Cookie header value (`http_cookie`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Value of the HTTP Cookie request header: one or more cookie-name=cookie-value pairs separated by a semicolon and a space, as RFC 6265 defines it. Cookies often carry session identifiers, so the value can grant access to an account.

- Personal data (PII): no
- Categories: Internet (internet), Secrets and credentials (passwords, keys, tokens) (secrets)
- Countries: global
- Languages: Common to most languages (common)

## Detection

Regular expression (Python `re`):

```
^[!#$%&'*+.^_`|~0-9A-Za-z-]+=(?:"[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*"|[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*)(?:; [!#$%&'*+.^_`|~0-9A-Za-z-]+=(?:"[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*"|[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]*))*$
```

## Examples

- `SID=31d4d96e407aad42; lang=en-US` — Example from RFC 6265
- `SID=31d4d96e407aad42;lang=en-US` (invalid example) — No space after the semicolon

## Mappings

- misp: `cookie`

## Supported by tools

- `datadogsds`

## Sources

- doc: <https://www.rfc-editor.org/rfc/rfc6265#section-4.2.1>

## Quality

Score 88/100. Missing: second example, translation.

JSON: <https://registry.apicrafter.io/api/v1/datatypes/http_cookie.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/internet/http_cookie.yaml>
