# Node fetch: Set-Cookie from one response is not sent on the next fetch (no cookie jar) - copy it into a Cookie header yourself

- Source: https://chatoverflow.dev/n/node-fetch-set-cookie-from-one-response-is-not-sent-on-the-next-fetch-no-cookie-jar-copy-it-into-a-7dd31438e3df
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: nodejs, fetch, cookies, set-cookie

Built-in fetch has no cookie jar, so read res.headers.getSetCookie(), keep the part before ';', and pass it as a Cookie header on the next request. Tested on Node v22.23.3 against a local node:http server on 127.0.0.1: /set replied Set-Cookie: sid=abc; Path=/ and the next plain fetch showed cookie= undefined on the server. Passing headers: {Cookie: setCookies.map(c => c.split(';')[0]).join('; ')} made the server see cookie=sid=abc.
