Part of the API freeze (#110). Decided: in before rc.1.
Blocker found while scoping: response headers are Record<string, string> everywhere: TransformerFn (src/metadata.ts:6), ErrorResponse (src/transformers.ts:9), HttpError.headers (src/signals.ts:38) and the buffered outcome in src/http/core.ts:104. Two Set-Cookie headers can't be joined with a comma the way other headers can (RFC 6265 §3), so today there's no way to set two cookies. Widening the value to string | string[] changes public types, which is why it lands before the freeze.
Shape:
Read: @cookie('session') and @cookies() argument decorators, next to @header. The parse follows RFC 6265: first value wins, %-decoding, malformed pairs skipped.
Write: setCookie(name, value, options), returning the header string, plus the widened header type so a handler, transformer or HttpError can send several. Options: maxAge, expires, path, domain, secure, httpOnly, sameSite, partitioned.
Safe defaults: httpOnly: true, sameSite: 'lax', path: '/', and secure on when the request is secure (already derived for HSTS). Names and values are validated, and CR/LF is refused (header injection).
Signing is out: that's sessions, which stay out of core (README, "Bring your own auth").
Tests: two cookies on one response on all four runtimes (Node needs an array for setHeader, fetch needs headers.append), the parse edge cases, and injection refused.
Part of the API freeze (#110). Decided: in before rc.1.
**Blocker found while scoping:** response headers are `Record<string, string>` everywhere: `TransformerFn` (src/metadata.ts:6), `ErrorResponse` (src/transformers.ts:9), `HttpError.headers` (src/signals.ts:38) and the buffered outcome in src/http/core.ts:104. Two `Set-Cookie` headers can't be joined with a comma the way other headers can (RFC 6265 §3), so today there's no way to set two cookies. Widening the value to `string | string[]` changes public types, which is why it lands before the freeze.
**Shape:**
- Read: `@cookie('session')` and `@cookies()` argument decorators, next to `@header`. The parse follows RFC 6265: first value wins, `%`-decoding, malformed pairs skipped.
- Write: `setCookie(name, value, options)`, returning the header string, plus the widened header type so a handler, transformer or `HttpError` can send several. Options: `maxAge`, `expires`, `path`, `domain`, `secure`, `httpOnly`, `sameSite`, `partitioned`.
- Safe defaults: `httpOnly: true`, `sameSite: 'lax'`, `path: '/'`, and `secure` on when the request is secure (already derived for HSTS). Names and values are validated, and CR/LF is refused (header injection).
- Signing is **out**: that's sessions, which stay out of core (README, "Bring your own auth").
**Tests:** two cookies on one response on all four runtimes (Node needs an array for `setHeader`, fetch needs `headers.append`), the parse edge cases, and injection refused.
Fixed in 26.11.0-rc.1 (7f9a0ee). From the changelog:
Response header values are string | string[] (#113, D11). TransformerFn, ErrorResponse.headers, HttpError.headers / HttpErrorLike.headers and the pipeline's ResponseShape.headers widen from Record<string, string>, so a response can carry several Set-Cookie lines. Code that produces headers is unaffected; code that readsheaders[k] from one of these types as a string stops compiling and must handle the array. A set-cookie array is sent as one header line per element on Node, Deno, Bun and the edge — before, the fetch adapters stringified it into one broken a,b cookie. Any other array is sent as one line joined with , . Injected security and CORS headers stay authoritative, and a handler's vary array is merged with the injected one.
@cookie('name') / @cookies() argument decorators and setCookie() (#113). Cookies are parsed from the request's Cookie header on first use per request (RFC 6265: first value wins, %-sequences decoded, malformed pairs skipped rather than answered with a 400), on HTTP and WebSocket routes; @needs('cookies') gives the same map. OpenAPI lists a cookie argument as an in: cookie parameter. setCookie(name, value, options?) returns a Set-Cookie value with HttpOnly, SameSite=Lax, Path=/ and Secure by default (D10; secure: false opts out), and throws, naming the field, on a name outside the token set, a value with CR, LF, ;, ,, whitespace or a control character, an attribute with CR/LF, ; or a control character, and on sameSite: 'none' or partitioned without secure. parseCookies() and CookieOptions are exported too. No dependency: signing and sessions stay out of core.
Fixed in **26.11.0-rc.1** (`7f9a0ee`). From the changelog:
- **Response header values are `string | string[]`** (#113, D11). `TransformerFn`, `ErrorResponse.headers`, `HttpError.headers` / `HttpErrorLike.headers` and the pipeline's `ResponseShape.headers` widen from `Record<string, string>`, so a response can carry several `Set-Cookie` lines. Code that *produces* headers is unaffected; code that *reads* `headers[k]` from one of these types as a `string` stops compiling and must handle the array. A `set-cookie` array is sent as one header line per element on Node, Deno, Bun and the edge — before, the fetch adapters stringified it into one broken `a,b` cookie. Any other array is sent as one line joined with `, `. Injected security and CORS headers stay authoritative, and a handler's `vary` array is merged with the injected one.
- **`@cookie('name')` / `@cookies()` argument decorators and `setCookie()`** (#113). Cookies are parsed from the request's `Cookie` header on first use per request (RFC 6265: first value wins, `%`-sequences decoded, malformed pairs skipped rather than answered with a 400), on HTTP and WebSocket routes; `@needs('cookies')` gives the same map. OpenAPI lists a cookie argument as an `in: cookie` parameter. `setCookie(name, value, options?)` returns a `Set-Cookie` value with `HttpOnly`, `SameSite=Lax`, `Path=/` and `Secure` by default (D10; `secure: false` opts out), and throws, naming the field, on a name outside the token set, a value with CR, LF, `;`, `,`, whitespace or a control character, an attribute with CR/LF, `;` or a control character, and on `sameSite: 'none'` or `partitioned` without `secure`. `parseCookies()` and `CookieOptions` are exported too. No dependency: signing and sessions stay out of core.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Part of the API freeze (#110). Decided: in before rc.1.
Blocker found while scoping: response headers are
Record<string, string>everywhere:TransformerFn(src/metadata.ts:6),ErrorResponse(src/transformers.ts:9),HttpError.headers(src/signals.ts:38) and the buffered outcome in src/http/core.ts:104. TwoSet-Cookieheaders can't be joined with a comma the way other headers can (RFC 6265 §3), so today there's no way to set two cookies. Widening the value tostring | string[]changes public types, which is why it lands before the freeze.Shape:
@cookie('session')and@cookies()argument decorators, next to@header. The parse follows RFC 6265: first value wins,%-decoding, malformed pairs skipped.setCookie(name, value, options), returning the header string, plus the widened header type so a handler, transformer orHttpErrorcan send several. Options:maxAge,expires,path,domain,secure,httpOnly,sameSite,partitioned.httpOnly: true,sameSite: 'lax',path: '/', andsecureon when the request is secure (already derived for HSTS). Names and values are validated, and CR/LF is refused (header injection).Tests: two cookies on one response on all four runtimes (Node needs an array for
setHeader, fetch needsheaders.append), the parse edge cases, and injection refused.Merged into develop in #140 (CARD-14, FPRD-001c, 2026-10-23). Left open until the 1c acceptance gate (CARD-22), per the 1a/1b convention.
Fixed in 26.11.0-rc.1 (
7f9a0ee). From the changelog:Response header values are
string | string[](#113, D11).TransformerFn,ErrorResponse.headers,HttpError.headers/HttpErrorLike.headersand the pipeline'sResponseShape.headerswiden fromRecord<string, string>, so a response can carry severalSet-Cookielines. Code that produces headers is unaffected; code that readsheaders[k]from one of these types as astringstops compiling and must handle the array. Aset-cookiearray is sent as one header line per element on Node, Deno, Bun and the edge — before, the fetch adapters stringified it into one brokena,bcookie. Any other array is sent as one line joined with,. Injected security and CORS headers stay authoritative, and a handler'svaryarray is merged with the injected one.@cookie('name')/@cookies()argument decorators andsetCookie()(#113). Cookies are parsed from the request'sCookieheader on first use per request (RFC 6265: first value wins,%-sequences decoded, malformed pairs skipped rather than answered with a 400), on HTTP and WebSocket routes;@needs('cookies')gives the same map. OpenAPI lists a cookie argument as anin: cookieparameter.setCookie(name, value, options?)returns aSet-Cookievalue withHttpOnly,SameSite=Lax,Path=/andSecureby default (D10;secure: falseopts out), and throws, naming the field, on a name outside the token set, a value with CR, LF,;,,, whitespace or a control character, an attribute with CR/LF,;or a control character, and onsameSite: 'none'orpartitionedwithoutsecure.parseCookies()andCookieOptionsare exported too. No dependency: signing and sessions stay out of core.