Skip to main content

RFC 6265 HTTP cookie parsing and domain/path scoping. Zero dependencies.

Project description

httpdex-cookies

RFC 6265 cookie parsing and storage. Zero dependencies.

Highlights

  • Parse Set-Cookie headers with domain validation and public suffix rejection
  • Domain/path/secure scoping per RFC 6265
  • Host-only cookies (no Domain attribute) restricted to exact origin
  • Default-path computation per RFC 6265 Section 5.1.4

Usage

from httpdex_cookies import CookieStore, parse_set_cookie

# Parse a Set-Cookie header
cookie = parse_set_cookie("session=abc; Path=/; Secure", "https://example.com/")

# Store and retrieve cookies
store = CookieStore()
store.extract_cookies("https://example.com/", [("set-cookie", "session=abc")])
header = store.get_cookie_header("https://example.com/api")  # "session=abc"

Public API

  • Cookie - single cookie with domain/path/secure/expiry scoping
  • CookieStore - domain/path-scoped cookie store with dict-like access
  • parse_set_cookie(header, request_url) - parse Set-Cookie header into a Cookie

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpdex_cookies-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

httpdex_cookies-0.1.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file httpdex_cookies-0.1.0.tar.gz.

File metadata

  • Download URL: httpdex_cookies-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for httpdex_cookies-0.1.0.tar.gz
Algorithm Hash digest
SHA256 98b8f3d297c0e4ac339f3cd73121158c80b5ea1316db51bdb4212896db32b5f2
MD5 b26ee685311d215c8b7b2bba68bc622b
BLAKE2b-256 001e2476f3f04e752c3e17af2565955e246352daa0fc7e40feb67f07d5ad7008

See more details on using hashes here.

File details

Details for the file httpdex_cookies-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: httpdex_cookies-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for httpdex_cookies-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 81f01e4f7b8274d3c3eab843a2d739f65c5ba8eb486b67cfa27a490039c5b935
MD5 9d4bf882030adac1196956f6c2847161
BLAKE2b-256 ff9c26d0a558399337aea4ed4662639ea423920f77f4a6de4952a328649adf61

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page