{"record":{"id":"8ba5113f77bd346f","repo":"Kong/insomnia","slug":"unable-to-read-cookie-cookie-8ba511","errorCode":null,"errorMessage":"Unable to read cookie: ${cookie}","messagePattern":"Unable to read cookie: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/insomnia/src/main/ipc/cookies.ts","lineNumber":30,"sourceCode":"  setCookieStrings: string[];\n  currentUrl: string;\n  cookieJar: Cookie[];\n}\n\ninterface AddSetCookiesResult {\n  cookies: Cookie[];\n  rejectedCookies: string[];\n}\n\nconst parseCookieFromJSON = (cookie: CookieInput) => {\n  return typeof cookie === 'string' ? ToughCookie.fromJSON(cookie) : ToughCookie.fromJSON(cookie);\n};\n\nconst cookieToString = (cookie: CookieInput) => {\n  const parsedCookie = parseCookieFromJSON(cookie);\n\n  if (parsedCookie === null) {\n    throw new Error(`Unable to read cookie: ${cookie}`);\n  }\n\n  let value = parsedCookie.toString();\n\n  if (parsedCookie.domain && parsedCookie.hostOnly) {\n    value += `; Domain=${parsedCookie.domain}`;\n  }\n\n  return value;\n};\n\nconst getCookiesForUrl = (cookies: Cookie[], url: string): Cookie[] => {\n  try {\n    const sanitized = cookies.map(c => ({\n      ...c,\n      expires: c.expires === null || c.expires === undefined ? 'Infinity' : c.expires,\n    }));\n    const jar = CookieJar.fromJSON(JSON.stringify({ cookies: sanitized }));","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/Kong/insomnia/blob/d9bb2b0142600f21309832daea3317942d285984/packages/insomnia/src/main/ipc/cookies.ts#L12-L48","documentation":"Error \"Unable to read cookie: ${cookie}\" thrown in Kong/insomnia.","triggerScenarios":"Thrown at packages/insomnia/src/main/ipc/cookies.ts:30 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"d9bb2b0142600f21309832daea3317942d285984","analyzedAt":"2026-08-26T18:04:05.187Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}