tough-cookie.prefixsecurityenum.md

February 7, 2025 ยท View on GitHub

Home > tough-cookie > PrefixSecurityEnum

PrefixSecurityEnum variable

Cookie prefixes are a way to indicate that a given cookie was set with a set of attributes simply by inspecting the first few characters of the cookie's name. These are defined in RFC6265bis - Section 4.1.3.

The following values can be used to configure how a CookieJar enforces attribute restrictions for Cookie prefixes:

  • silent - Enable cookie prefix checking but silently ignores the cookie if conditions are not met. This is the default configuration for a CookieJar.

  • strict - Enables cookie prefix checking and will raise an error if conditions are not met.

  • unsafe-disabled - Disables cookie prefix checking.

Signature:

PrefixSecurityEnum: {
    readonly SILENT: "silent";
    readonly STRICT: "strict";
    readonly DISABLED: "unsafe-disabled";
}