Kong/insomnia · error · Error

failed to parse cookie, the cookie string seems invalid

Error message

failed to parse cookie, the cookie string seems invalid

What it means

Error "failed to parse cookie, the cookie string seems invalid" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia-scripting-environment/src/objects/cookies.ts:42

  httpOnly?: boolean;
  hostOnly?: boolean;
  session?: boolean;
  extensions?: { key: string; value: string }[];
}

export class Cookie extends Property {
  override readonly _kind: string = 'Cookie';
  protected cookie: ToughCookie;
  private extensions?: { key: string; value: string }[];
  private insoExtensions: InsomniaCookieExtensions = {};

  constructor(cookieDef: CookieOptions | string) {
    super();

    if (typeof cookieDef === 'string') {
      const cookieDefParsed = Cookie.parse(cookieDef);
      if (!cookieDefParsed) {
        throw new Error('failed to parse cookie, the cookie string seems invalid');
      }
      cookieDef = cookieDefParsed;
    }

    const def = { ...cookieDef };
    this.extensions = def.extensions ? [...def.extensions] : [];
    def.extensions = [];

    const cookie = ToughCookie.fromJSON(def);
    if (!cookie) {
      throw new Error('failed to parse cookie, the cookie string seems invalid');
    }

    this.id = cookieDef.id || '';
    this.cookie = cookie;
    this.insoExtensions = {
      creation: cookieDef.creation,
      creationIndex: cookieDef.creationIndex,

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia-scripting-environment/src/objects/cookies.ts:42 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/e3eeb27d398ef9f4. Report an issue: GitHub.