Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Consolidate the two cookie parsers `parseCookie` and `parseCookieHeader`

Open
#24,501 1 comment 0 reactions 1 assignee View on GitHub

@s1gr1d is already working on this.

Since Sep 18, 2026.

Assessment

This issue has not been assessed yet.

Description

javascript

parseCookie (used by filterCookies for event cookie records) and parseCookieHeader (used by httpHeadersToSpanAttributes for span attributes) have several differences:

  • Nameless segments: filterCookies('opaque-blob; theme=dark', true) returns {theme: 'dark'} and drops the blob silently. The span attribute shows ['[Filtered]', 'theme=dark'].
  • Set-Cookie attributes: filterCookies('sid=1; Max-Age=3600; Path=/', true) returns {sid: '[Filtered]', 'Max-Age': '3600', Path: '/'}. Max-Age and Path are metadata, not cookies. parseCookieHeader strips them.
  • Only parseCookie URL-decodes values and strips quotes.

One parser returning ordered [name, value][] pairs, with a Set-Cookie mode, could work at both call sites. filterCookies.test.ts has two it.fails tests pinning the intended Set-Cookie behavior -> those need to be flipped when fixed.

Out of the #24090 review: https://github.com/getsentry/sentry-javascript/pull/24090#discussion_r4041421140 and https://github.com/getsentry/sentry-javascript/pull/24090#discussion_r4041448119.

Dominant language
TypeScript
Stars
8.7k
Forks
1.9k
Avg merge
1d 18h
Merged PRs (30d)
543

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from getsentry/sentry-javascript

All issues in getsentry/sentry-javascript

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.