Skip to main content

Github Actions Status

Binary Cookies

CLI tool and Python library for reading and writing Binary Cookies.

Documentation

For detailed documentation, please visit the Binary Cookies Documentation

Requirements

  • Python >= 3.9

Installation

pip install binarycookies

CLI example:

bcparser path/to/cookies.binarycookies

Output:

[
  {
    "name": "session_id",
    "value": "abc123",
    "url": "https://example.com",
    "path": "/",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "Secure",
    "raw_flags": 1,
    "comment": null
  },
  {
    "name": "user_token",
    "value": "xyz789",
    "url": "https://example.com",
    "path": "/account",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "HttpOnly",
    "raw_flags": 4,
    "comment": null
  }
]

Output formats

The CLI supports multiple output formats using the --output flag.

  • json (default): Outputs cookies in JSON format.
  • ascii: Outputs cookies in a human-readable ASCII format with each cookie property on a separate line.
  • netscape: Outputs cookies in the Netscape cookie file format.

Basic Usage Python

Deserialization

import binarycookies 

with open("path/to/cookies.binarycookies", "rb") as f:
    cookies = binarycookies.load(f)

Serialization

import binarycookies 

cookie = {
    "name": "session_id",
    "value": "abc123",
    "url": "https://example.com",  # "domain" is accepted as an alias for "url"
    "path": "/",
    "create_datetime": "2023-10-01T12:34:56+00:00",
    "expiry_datetime": "2023-12-31T23:59:59+00:00",
    "flag": "Secure"
}

with open("path/to/cookies.binarycookies", "wb") as f:
    binarycookies.dump(cookie, f)

Optional fields:

  • comment: cookie comment string stored in the file (default: no comment)
  • raw_flags: the raw flags bitfield written to disk. When omitted, it is derived from flag (Secure = 1, HttpOnly = 4, Secure; HttpOnly = 5). Cookies read with load/loads always carry raw_flags, so unknown flag bits survive a read-modify-write round trip.

Ethical Use & Responsible Handling

This project is intended for lawful, ethical use only. Typical, appropriate uses include:

  • Inspecting Binary Cookies from your own devices or data you are authorized to access
  • DFIR, QA, and security testing performed with explicit, written permission
  • Educational/research work on datasets that are owned by you, anonymized, or publicly released for that purpose

You must not use this tool to:

  • Access, extract, modify, or distribute cookies from systems or accounts you do not own or have permission to analyze
  • Bypass authentication, session management, DRM, or other technical controls
  • Enable tracking, stalking, doxxing, fraud, or other privacy-invasive or harmful activities

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Pull requests are also welcome.

Metadata

Release files for binarycookies 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for binarycookies 2.4.0
File Size Uploaded
binarycookies-2.4.0.tar.gz 11.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for binarycookies 2.4.0
File Interpreter ABI Platform
binarycookies-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.7 kB

Release files / binarycookies-2.4.0.tar.gz

Download URL binarycookies-2.4.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
77d5b9bc4e4a1bbbc3f242f8436a972ab6d159ae5c701f7c94e29a0ae984b615
BLAKE2b-256 checksum
How to use checksums
1134187d54dcf8dbbc7b7c8abfd50b1802f5961f012719cd0440da60161da765
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release files / binarycookies-2.4.0-py3-none-any.whl

Download URL binarycookies-2.4.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3b4f3bc3092d086281aa8d3c7c4d56d020a1ba36292d0bcbb4150e9d2188f3bf
BLAKE2b-256 checksum
How to use checksums
15af78ef9508fc86fc82e929b1589735043cada1c89ad16bca79309345aa9438
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 29, 2026.

Transparency log

Release history Release notifications | RSS feed

2.5.1

2 release files

2.5.0

2 release files

This release

2.4.0 This release

2 release files

2.3.0

2 release files

2.2.3

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.5

2 release files

2.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page