Contents

HTTPCookie

A representation of an HTTP cookie.

Declaration

class HTTPCookie

Overview

An HTTPCookie object is immutable, initialized from a dictionary that contains the attributes of the cookie. This class supports two different cookie versions:

  • Version 0: The original cookie format defined by Netscape. Most cookies are in this format.

  • Version 1: The cookie format defined in RFC 6265, HTTP State Management Mechanism.

Topics

Creating cookies

Converting cookies to request headers

Getting cookie host properties

Getting cookie metadata

Determining cookie lifespan

Securing cookies

Accessing cookie properties as key-value pairs

Getting user-readable cookie metadata

Accepting cookies

See Also

Cookies