3 min read Updated August 17, 2026

Fix #HttpOnly_ cookies dropped as comments

#HttpOnly_ on a Netscape domain field is curl’s HttpOnly marker, not a comment. If a script skips every line starting with #, the session cookie disappears. Paste the file here: the parser strips the prefix, sets httpOnly: true, and JSON output keeps the flag.

True comments are lines that start with # but not #HttpOnly_. Those are still ignored.

#HttpOnly_ commentHttpOnly cookies.txtHttpOnly prefix Netscapecurl HttpOnly
  1. 1
    Confirm the prefix is on the cookie line

    A valid row looks like #HttpOnly_.example.com then tabs. A real comment is # This file was generated.

  2. 2
    Paste into the converter

    Output JSON Array should list the cookie with "httpOnly": true. Netscape output writes the prefix back — that is what curl wants.

  3. 3
    Replace naive scripts

    Do not grep -v "^#" a cookies.txt. Use this parser, curl, or CookieMan Import.

Cookies are credentials. Conversion stays in this page — delete the file when you are done.

Symptom → cause → fix

SymptomCauseFix
Session cookie missing after “parse”Filter dropped #HttpOnly_ linesUse a prefix-aware reader (this one)
JSON has httpOnly false after Netscape importReader treated the line as a commentRe-paste here; do not strip hashes first
File has only commentsExporter wrote a header and no rowsRe-export from CookieMan; empty jar
            # Netscape HTTP Cookie File
# a real comment — ignored
#HttpOnly_.example.com	TRUE	/	TRUE	1789200000	session_id	abc123
          
The serializer always emits #HttpOnly_ when httpOnly is true. Round-trip JSON → Netscape → JSON keeps the flag. SameSite is still lost on that path.

What the prefix is not

It is not an HTTP comment in the RFC 6265 sense. It is not a Chrome cookies API field. It is a curl jar convention that this library implements on purpose, including files whose only cookie is HttpOnly.

Questions people ask

Does wget understand #HttpOnly_?
wget’s Netscape reader accepts the same prefix curl uses. After load, HttpOnly is not a wget concept on the wire — it still sends the name=value.
Can I write HttpOnly as an eighth column?
No. Extra columns are folded into the value (tab-joined) on parse. Use the prefix or JSON.
Why keep JSON for Chrome if the prefix round-trips?
HttpOnly survives. SameSite and partition keys do not. Auth cookies often need more than HttpOnly.
3 min read

curl -b cookies.txt from JSON Export

Turn a Chrome JSON export into the Netscape file curl -b and -c expect: tabs, #HttpOnly_ prefixes, Unix-second expiry and a trailing newline.

curl cookies.txtcurl -b cookies Open the guide
3 min read

wget --load-cookies File from JSON

Convert a JSON cookie export to Netscape cookies.txt for wget --load-cookies. Keep session cookies with --keep-session-cookies or wget will drop expiry 0 on save.

wget --load-cookieswget cookies.txt Open the guide
3 min read

JSON Array vs cookies.txt Field Mapping

Side-by-side mapping of CookieMan JSON Array fields to Netscape cookies.txt. SameSite, partitionKey and store metadata never survive the seven-column file.

JSON vs cookies.txtcookies.txt field mapping Open the guide

Apply this on live cookies

The converter rewrites files. The extension reads and writes the jar in Chrome, including HttpOnly cookies.

Free and MIT-licensed · Chrome, Edge and other Chromium browsers · Nothing leaves your machine