skillfed

cookies

Friendlier RFC 6265-compliant cookie parser/renderer

cookies v2.2.1 259.6K downloads/30d#8,409 on PyPI31
Permissive license UNKNOWN Abandoned released

What it is and what it does

cookies.py is a single-file HTTP cookie parser and renderer that aims to be a cleaner, RFC 6265-compliant alternative to Python's built-in http.cookies module. It handles both Cookie request headers and Set-Cookie response headers, exposing a simpler API for creating, reading, and modifying cookies without the confusing behavior of the standard library's SmartCookie class.

The package includes test coverage and is designed to be liberal in what it accepts when parsing real-world cookie formats, while rendering output strictly according to RFC 6265. It has no runtime dependencies and can be dropped directly into a project as a single file. However, the project has been abandoned since 2014, with no updates to address modern Python versions or emerging security concerns.

Use it for:

  • Parsing Cookie headers from HTTP requests in a web framework or middleware layer
  • Rendering Set-Cookie response headers with proper RFC 6265 formatting and attribute handling
  • Replacing http.cookies in legacy projects where the standard library's API is too confusing or buggy
  • Building a custom HTTP client or server that needs reliable cookie parsing without external dependencies

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Parses and renders HTTP Cookie and Set-Cookie headers according to RFC 6265, providing a cleaner API than Python's standard http.cookies module.

No. While the package has low install friction and a permissive license, it is abandoned (last release 2014, last commit 2018) and its Python version support is unverified for modern interpreters. For new projects, use Python's built-in http.cookies or a maintained alternative. For legacy projects already using it, consider migrating to an actively maintained solution.

Install

cookies on PyPI

pip

pip install cookies

uv

uv add cookies

poetry

poetry add cookies

Installing cookies

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release was in 2014 and last commit in 2018, raising concerns about compatibility with modern Python versions.

License in practice

MIT license permits unrestricted use, modification, and distribution with no obligations beyond attribution.

Quickstart

from cookies import Cookies, Cookie
cookies = Cookies(name='value')
cookies['name'].path = '/'
print(cookies.render_request())

Package classifiers indicate support for Python 2.6, 2.7, 3.2, 3.3 and PyPy; compatibility with later versions is unverified.

Verify before relying

  • Whether this package actually works on Python versions beyond 3.3 despite classifiers claiming Python 3 support
  • Whether the parser handles modern cookie formats and edge cases encountered in production HTTP traffic
  • Security implications of using an unmaintained library for cookie handling in new projects

Package facts

License UNKNOWN (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 4,339 days since the last release
Last repo commit
First released
Downloads 259,617/month — #8,409 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cookies-2.2.1-py2.py3-none-any.whl

Development Status :: 4 - BetaEnvironment :: Other EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.2Programming Language :: Python :: 3.3Programming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

HTTP cookie parsingRFC 6265 cookie handlercookie header renderingcookie request/response headerscookie parser libraryset-cookie parsercookie manipulation
http-headersabandoned

More Python Modules packages