HTTP Cookie Serializer
Serialize ordered cookie pairs using RFC 6265 cookie octets without implicit escaping or decoding.
Description
A Cookie field sends ordered name/value pairs from client to server.
When to use HTTP Cookie Serializer
Use this tool to serialize ordered cookie pairs using RFC 6265 cookie octets without implicit escaping or decoding.
Prepare the header field value, cookie records or status code requested. Supply field values without a header-name prefix and preserve syntax for the parser to inspect.
How to use HTTP Cookie Serializer and understand its results
- Prepare the header field value, cookie records or status code requested. Supply field values without a header-name prefix and preserve syntax for the parser to inspect.
- Enter cookies using the field table and calculation rules, then run the tool.
- Read header. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
| Input field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| cookies | Cookie pairs to serialize. | list of object; minimum entries: 0; maximum entries: 100000 | Required |
Enter cookie objects with nonempty ASCII token names and cookie-octet values. Empty values and an empty list are allowed. Reject spaces, quotes, comma, semicolon, backslash, controls and non-ASCII values; join the pairs unchanged with semicolon-space. Return a field value, without a Cookie: prefix.3
header=join(name=value, "; ") Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| header | Serialized Cookie field value. | string; maximum length: 1000000 |
{
"input": {
"cookies": [
{
"name": "session",
"value": "abc%20123"
},
{
"name": "theme",
"value": "dark"
}
]
},
"output": {
"header": "session=abc%20123; theme=dark"
}
} Limitations and assumptions
No escaping, percent-decoding, cookie selection, attribute handling or browser storage is performed.
Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.
Alternative or Complementary methods
Use HTTP Set-Cookie Serializer: Serialize one cookie pair and explicit attributes while rejecting characters that can create additional header fields. For a complementary task, use HTTP Cookie Parser: Parse a Cookie header into ordered name and value pairs while preserving duplicate cookie names and encoded values.
Further background: RFC 6265: HTTP State Management Mechanism.
References
-
HTTP Cookie Serializer — tool.io
-
RFC 6265: HTTP State Management Mechanism — Internet Engineering Task Force
Similar or alternative tools
- HTTP Set-Cookie Serializer
Serialize one cookie pair and explicit attributes while rejecting characters that can create additional header fields.
- HTTP Cookie Parser
Parse a Cookie header into ordered name and value pairs while preserving duplicate cookie names and encoded values.