- 1 Get a full-fidelity export
CookieMan JSON Array, not a JSON map. Maps default every cookie to
localhost— JSON Map vs JSON Array. - 2 Convert to Netscape
Paste the array. Download cookies.txt. HttpOnly becomes
#HttpOnly_, which MozillaCookieJar understands. - 3 Load the jar in Requests
Use the snippet below. Point
requests.getat a URL whose host matches column 1 of the file.
Working Requests snippet
from http.cookiejar import MozillaCookieJar
import requests
jar = MozillaCookieJar("cookies.txt")
jar.load(ignore_discard=True, ignore_expires=True)
session = requests.Session()
session.cookies = jar
response = session.get("https://example.com/dashboard")
print(response.status_code)
ignore_expires=True loads expired rows for debugging. Do not ship that flag in production jobs. Cookie files are credentials — keep them out of source control. Header-only alternative
If you only need one call and do not care about Domain matching, convert to Header String and pass headers={"Cookie": "..."}. That bypasses the jar and will not store Set-Cookie from the response unless you also use a Session.
| Input you have | Convert to | Requests API |
|---|---|---|
| JSON Array with domains | Netscape | MozillaCookieJar.load |
| JSON Array | Header String | headers={"Cookie": ...} |
| JSON Map | JSON Array, then edit domains | Do not load a map as a jar |