<!--
Copyright 2020 The Chromium Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<!--
This file is used to generate a comprehensive list of Cookie histograms
along with a detailed description for each histogram.

For best practices on writing histogram descriptions, see
https://chromium.googlesource.com/chromium/src.git/+/HEAD/tools/metrics/histograms/README.md

Please follow the instructions in the OWNERS file in this directory to find a
reviewer. If no OWNERS file exists, please consider signing up at
go/reviewing-metrics (Googlers only), as all subdirectories are expected to
have an OWNERS file. As a last resort you can send the CL to
chromium-metrics-reviews@google.com.
-->

<histogram-configuration>

<histograms>

<histogram name="Cookie.AndroidOTRRestore" enum="BooleanEnabled"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Emits when a cookie restore is attempted by Android Incognito Mode session
    restoration. This happens if an in-progress incognito session is killed by
    the system (e.g., memory pressure) and not by the user.

    The enum value is true when the cookie was restored properly and false if it
    was rejected. Rejection should be rare as the cookies are directly written
    out by the system.
  </summary>
</histogram>

<histogram name="Cookie.AvgCookieJarSizePerKey2" units="bytes"
    expires_after="2027-02-28">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the average sum of the sizes of the name and value of
    all cookies per domain. This metric is recorded every 10 minutes.
  </summary>
</histogram>

<histogram name="Cookie.CommitProblem" enum="CookieCommitProblem"
    expires_after="2027-01-24">
  <owner>morlovich@chromium.org</owner>
  <summary>
    Recorded when a problem occurs trying to commit changes to the cookie store
    back to disk, in the SQLite store.
  </summary>
</histogram>

<histogram name="Cookie.CookieJarSize" units="kibibytes"
    expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the sum of the sizes of the name and value of all
    cookies in the cookie jar. This metric is recorded every 10 minutes.
  </summary>
</histogram>

<histogram name="Cookie.CookiePartitionSizeKibibytes" units="kibibytes"
    expires_after="2026-12-20">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the sum of the sizes of the name and value of all
    cookies in a single partition of the partitioned cookie jar. This metric is
    recorded every 10 minutes and emits one event per partition. This metric is
    only recorded when partitioned cookies are enabled.
  </summary>
</histogram>

<histogram name="Cookie.CookiePrefix.Subsampled" enum="CookiePrefix"
    expires_after="2025-07-13">
  <owner>estark@chromium.org</owner>
  <summary>
    Number of times a cookie was set with a name prefixed by
    &quot;__Secure-&quot; or &quot;__Host-&quot; (prefixes reserved by
    https://tools.ietf.org/html/draft-west-cookie-prefixes).

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.CookieSchemeRequestScheme" enum="CookieRequestScheme"
    expires_after="2026-10-26">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The scheme a cookie was set by and the scheme of the request that the cookie
    was sent to. This is recorded once per cookie each time a URL request has
    its headers set.

    Warning: this histogram was expired from 2026-07-29 to 2026-08-25; data may
    be missing.
  </summary>
</histogram>

<histogram name="Cookie.CookieSourceSchemeName.Subsampled"
    enum="CookieSourceSchemeName" expires_after="2026-03-26">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    For each cookie added to the store, record the source URL's scheme. Schemes
    we're unfamiliar with will be put into the &quot;Other Scheme&quot; bucket.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.CorruptMetaTableRecovered" enum="Boolean"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This metric records whether the DB could be reinitialized after corruption.
    Note that corruption could occur due to attempting to load an unsupported
    variant of the cookie db (e.g., code supports v15+ and tries to load v12).
    If recorded as true, recovery was possible. If recorded as false, then
    recovery was not possible for some reason. The latter should be rare. This
    metric is recorded when the cookie DB is first initialized.
  </summary>
</histogram>

<histogram name="Cookie.Count2" units="units" expires_after="2027-01-17">
  <owner>morlovich@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of cookies in the store (recorded every 10 minutes of active browsing
    time), with a wider range than Cookie.Count.
  </summary>
</histogram>

<histogram name="Cookie.CreateDatabaseEarly" enum="BooleanCreated"
    expires_after="2026-12-20">
  <owner>yoichio@chromium.org</owner>
  <owner>chrome-loading@google.com</owner>
  <summary>
    Records whether MaybeInitializeDatabaseEarly actually attempted to create
    the database early, regardless of success or failure. Logged on every call
    to SQLitePersistentCookieStore::Backend::MaybeInitializeDatabaseEarly
  </summary>
</histogram>

<histogram
    name="Cookie.CrossSiteRedirectDowngradeChangesInclusion2.{AccessType}"
    enum="CookieSameSite2" expires_after="2026-04-07">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The SameSite attribute of a cookie whose inclusion is changed by considering
    redirects as part of the same-site context calculation. I.e., this is logged
    for cookies which are included if not considering redirects when calculating
    the same-site context, but are excluded (solely due to the SameSite
    attribute) if cross-site redirects can cause a request to be considered
    cross-site. This is only recorded for cookies accessed over HTTP, since
    redirects are not relevant for JS cookie accesses. This is logged for each
    cookie (whose inclusion is changed) when it is {AccessType}, regardless of
    whether the cookie was ultimately included.
  </summary>
  <token key="AccessType">
    <variant name="Read" summary="read for a request"/>
    <variant name="Write" summary="set by a response"/>
  </token>
</histogram>

<histogram name="Cookie.CrossSiteRedirectType.{AccessType}.Subsampled"
    enum="ContextRedirectTypeBug1221316" expires_after="2026-10-26">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The type of redirects a cookie experienced before ultimately being accessed.
    This metric is triggered whenever a cookie is attempted to be accessed by an
    HTTP request or response. It does not matter if the access succeeds, only
    that one was attempted.

    The metrics exists primarily to act as a denominator for
    Cookie.CrossSiteRedirectDowngradeChangesInclusion2.{AccessType}.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.

    Warning: this histogram was expired from 2025-08-10 to 2025-02-24; data may
    be missing.

    Warning: this histogram was expired from 2026-08-10 to 2026-08-25; data may
    be missing.
  </summary>
  <token key="AccessType">
    <variant name="Read" summary="read for a request"/>
    <variant name="Write" summary="set by a response"/>
  </token>
</histogram>

<histogram name="Cookie.DaysSinceRefreshForRetrieval" units="days"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of days since a cookie was updated, collected when cookies are loaded
    into memory at browser start. This is used to track how many cookies are in
    danger of expiring due to the proposed 400 day maximum expiration day limit.
  </summary>
</histogram>

<histogram name="Cookie.DomainHasNonASCII" enum="Boolean"
    expires_after="2024-11-17">
  <owner>johannhof@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Whether a site tried to set a cookie with a Domain attribute that has at
    least one non-ASCII character in it.

    This metric is recorded everytime a cookie is created from a string (i.e.
    when it is set via Set-Cookie or document.cookie write), regardless of
    whether or not the cookie is ultimately stored.
  </summary>
</histogram>

<histogram name="Cookie.DomainSet.Subsampled" enum="Boolean"
    expires_after="2026-10-26">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Was a cookie set with a Domain attribute.

    This metric is recorded once per included cookie on set attempts.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.

    Warning: this histogram was expired from 2026-08-09 to 2026-08-25; data may
    be missing.
  </summary>
</histogram>

<histogram name="Cookie.DoubleUnderscorePrefixedName.Subsampled" enum="Boolean"
    expires_after="2026-05-24">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Records if a cookie has a double underscore prefixed name, excluding the
    cookie prefixes. I.e.: __Secure- and __Host- prefixed names are ignored.

    This metric is recorded when a cookie is successfully created using
    CanonicalCookie::Create.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.EncryptedAndPlaintextValues" enum="Boolean"
    expires_after="2026-06-07">
  <owner>wfh@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Records whether or not an entry in the cookie database has both encrypted
    and plaintext values, which should not happen.

    This metric is recorded every time a cookie is parsed from the cookie
    database during load.
  </summary>
</histogram>

<histogram name="Cookie.ErrorInitializeDB" enum="SqliteLoggedResultCode"
    expires_after="2027-01-17">
  <owner>wfh@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The exact database error encountered if initializing the cookies database
    fails catastrophically. Initializing the cookies database happens once per
    network context configured with persistent cookies, so this metric could be
    reported multiple times from the same client. Catastrophic errors are
    defined in sql::IsErrorCatastrophic.
  </summary>
</histogram>

<histogram name="Cookie.Experimental.CookiesAllowedForUrlsUsage"
    enum="CookiesAllowedForUrlsUsage" expires_after="2026-10-26">
  <owner>dylancutler@google.com</owner>
  <owner>sandormajor@chromium.org</owner>
  <summary>
    Records what types of rules are present in the CookiesAllowedForUrls policy.
    This policy supports content settings that only apply to the cookie's site,
    only apply to the top-level site, and rules that apply to both. This
    histogram is recorded when the CookiesAllowedForUrls policy is first loaded.
    Only recorded when the policy contains at least one valid rule.

    Warning: this histogram was expired from 2026-07-09 to 2026-08-25; data may
    be missing.
  </summary>
</histogram>

<histogram name="Cookie.ExpirationDurationMinutesNonSecure.Subsampled2"
    units="minutes" expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>kaustubhag@chromium.org</owner>
  <summary>
    Number of minutes until non-Secure cookie expires when set.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.

    The buckets range max was resized from 10 years in minutes in
    Cookie.ExpirationDurationMinutesNonSecure.Subsampled to 400 days in minutes
    as that's the cap on cookie max-age.
  </summary>
</histogram>

<histogram name="Cookie.ExpirationDurationMinutesSecure.Subsampled2"
    units="minutes" expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>kaustubhag@chromium.org</owner>
  <summary>
    Number of minutes until Secure cookie expires when set.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.

    The buckets range max was resized from 10 years in minutes in
    Cookie.ExpirationDurationMinutesSecure.Subsampled to 400 days in minutes as
    that's the cap on cookie max-age.
  </summary>
</histogram>

<histogram name="Cookie.FirstPartySets.{Context}.DelayedQueriesCount"
    units="queries" expires_after="2026-11-29">
  <owner>cfredric@chromium.org</owner>
  <owner>kaustubhag@chromium.org</owner>
  <summary>
    The number of queries that were delayed (i.e. answered asynchronously
    instead of synchronously).

    Recorded once during initialization, for each context. (This means once per
    browser-run in the browser process; and once each time the Network Service
    is started.) The metric is emitted even when First-Party Sets is disabled.
  </summary>
  <token key="Context">
    <variant name="Browser"/>
  </token>
</histogram>

<histogram name="Cookie.FirstPartySets.{Context}.MostDelayedQueryDelta"
    units="ms" expires_after="2027-02-07">
  <owner>cfredric@chromium.org</owner>
  <owner>kaustubhag@chromium.org</owner>
  <summary>
    The length of time between when the first asynchronous query was received,
    and when asynchronous queries started to be answered.

    Recorded once during initialization, for each context. (This means once per
    browser-run in the browser process; and once each time the Network Service
    is started.) Recorded for all clients, even those with low-resolution
    clocks.

    If the context was initialized before any queries were made (including if
    the feature is disabled entirely), 0 is recorded.
  </summary>
  <token key="Context">
    <variant name="Browser"/>
  </token>
</histogram>

<histogram name="Cookie.FromStorageWithValidLength.{CallSite}.Subsampled"
    enum="BooleanValid" expires_after="2026-09-20">
  <owner>awillia@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    If a canonical cookie created via the given caller has a valid name+value
    length. Logged whenever a cookie is created FromStorage and if this cookie
    IsCanonical.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
<!-- LINT.IfChange(CanonicalCookieFromStorageCallSite) -->

  <token key="CallSite">
    <variant name="AndroidCookiesFetcherRestoreUtil"/>
    <variant name="ChromeOsCookieSyncConversions"/>
    <variant name="CookieManager"/>
    <variant name="CookieManagerMojomTraits"/>
    <variant name="OauthMultiloginResult"/>
    <variant name="RestrictedCookieManager"/>
<!-- Intentionally omitting IosSystemCookieUtil -->

    <variant name="SqlitePersistentCookieStore"/>
    <variant name="Tests"/>
  </token>
<!-- LINT.ThenChange(/net/cookies/canonical_cookie.h:CanonicalCookieFromStorageCallSite) -->

</histogram>

<histogram name="Cookie.GetCookieListWithOptions.Duration.Subsampled"
    units="microseconds" expires_after="2027-01-17">
  <owner>anthonyvd@chromium.org</owner>
  <owner>chrome-catan@google.com</owner>
  <summary>
    Records the time spent executing CookieMonster::GetCookieListWithOptions,
    plus its callback if the callback is invoked synchronously.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.

    Not reported for clients with low-resolution clocks.
  </summary>
</histogram>

<histogram name="Cookie.HasNonASCII.{CookieField}.Subsampled" enum="Boolean"
    expires_after="2025-07-27">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    If a cookie's {CookieField} field contains a non-ASCII character.
    Informally, this indicates if the field contains a (non-ASCII) Unicode
    character. Logged whenever a cookie is created via
    CanonicalCookie::Create(). When kDisallowNonAsciiCookies is enabled and a
    cookie's {CookieField} field contains a non-ASCII character, this metric
    will not be recorded.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
  <token key="CookieField">
    <variant name="Name"/>
    <variant name="Value"/>
  </token>
</histogram>

<histogram name="Cookie.IncludedRequestEffectiveSameSite.Subsampled"
    enum="CookieEffectiveSameSite" expires_after="2026-10-25">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The value of the effective samesite for cookies that will be included in a
    request. Logged once per successful inclusion.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.IncludedResponseEffectiveSameSite.Subsampled"
    enum="CookieEffectiveSameSite" expires_after="2025-05-04">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The value of the effective samesite for cookies that will be accepted from a
    response. Logged once per successful inclusion.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.IsPartitionedValid.Subsampled" enum="BooleanValid"
    expires_after="2027-03-01">
  <owner>dylancutler@google.com</owner>
  <owner>selya@google.com</owner>
  <summary>
    If a cookie line contains the Partitioned attribute, this histogram logs
    whether it was used correctly (must have a __Host- prefix and must not have
    the SameParty attribute). Logged whenever a cookie is created from a string
    (from a Set-Cookie header or a write to document.cookie).

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.IsPersistentWhenSet.Subsampled" enum="Boolean"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>kaustubhag@chromium.org</owner>
  <summary>
    Whether a cookie set via CookieMonster::SetCanonicalCookie or
    CookieMonster::SetAllCookies is persistent (true) or session (false).

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.LoadProblem" enum="CookieLoadProblem"
    expires_after="2027-01-03">
  <owner>morlovich@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Recorded when a problem is recorded when loading the persistent cookie
    store. Value 5 was added in M96. Values 6 and 7 were added in M131.
  </summary>
</histogram>

<histogram name="Cookie.MaxCookieJarSizePerKey" units="kibibytes"
    expires_after="2027-02-28">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the maximum sum of the sizes of the name and value of
    all cookies that a single domain is using. This metric is recorded every 10
    minutes.
  </summary>
</histogram>

<histogram name="Cookie.MaxSameSiteNoneCookiesPerKey" units="units"
    expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Maximum number of SameSite=None cookies that belong to a single domain on
    the client. This histogram will be used to inform the
    per-partition-per-domain limit for partitioned cookies. Recorded every 10
    minutes of active browsing time.
  </summary>
</histogram>

<histogram name="Cookie.NameOrValueHtab.Subsampled" enum="Boolean"
    expires_after="2025-07-27">
  <owner>awillia@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Records whether or not a cookie has internal HTABs in either its name or
    value. Leading and trailing HTABs are ignored.

    This metric is recorded when CanonicalCookie::Create is called, regardless
    whether the cookie is successfully created or not.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.OnCookiesAccessed.BatchSize" units="accesses"
    expires_after="2026-05-03">
  <owner>olivierli@chromium.org</owner>
  <owner>catan-team@chromium.org</owner>
  <summary>
    Records the number of cookie access details batches received in
    RenderFrameHostImpl. Recorded every time accesses are reported from the
    network service.
  </summary>
</histogram>

<histogram name="Cookie.OnCookiesAccessed.BatchSize.CookieAccessObserver"
    units="accesses" expires_after="2027-01-17">
  <owner>kawasin@chromium.org</owner>
  <owner>catan-team@chromium.org</owner>
  <summary>
    Records the number of cookie access details batches received in
    StoragePartitionImpl::ServiceWorkerCookieAccessObserver. Recorded every time
    accesses are reported from CookieAccessObserver. This will be used to decide
    whether to optimize StoragePartitionImpl::ServiceWorkerCookieAccessObserver
    or not.
  </summary>
</histogram>

<histogram name="Cookie.OnCookiesAccessed.TotalAccesses" units="accesses"
    expires_after="2026-07-05">
  <owner>olivierli@chromium.org</owner>
  <owner>catan-team@chromium.org</owner>
  <summary>
    Records the number of cookie access details received in RenderFrameHostImpl.
    Recorded every time accesses are reported from the network service.
  </summary>
</histogram>

<histogram name="Cookie.OnPreconnect.LoadCookie" enum="BooleanAttempted"
    expires_after="2026-12-27">
  <owner>yoichio@chromium.org</owner>
  <owner>chrome-loading@chromium.org</owner>
  <summary>
    Whether a task to load cookies for a url from the backing store was posted
    in response to a preconnect request for the url.

    Recorded when kEarlyCookieLoadOnPreconnect is enabled,
    NetworkContext::PreconnectSockets() is called and the URLRequestContext has
    a cookie store.
  </summary>
</histogram>

<histogram name="Cookie.Parse.EmptyName" enum="Boolean"
    expires_after="2027-01-03">
  <owner>morlovich@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Whether a site tried to set a cookie with an empty name.

    Recorded when creating a cookie from a parseable set-cookie string.
  </summary>
</histogram>

<histogram name="Cookie.Parse.EmptyNameAmbiguousValue" enum="Boolean"
    expires_after="2027-01-03">
  <owner>morlovich@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Whether a site tried to set a cookie with an empty name and a value
    containing =, which can result in parsing ambiguity on Cookie: headers.

    Recorded when creating a cookie from a parseable set-cookie string whose
    name is empty.
  </summary>
</histogram>

<histogram name="Cookie.Parse.EmptyNameParseType{SourceType}"
    enum="NamelessCookieLineParseType" expires_after="2027-02-07">
  <owner>chlily@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    When a cookie with empty name is successfully created via {SourceType}, this
    histogram logs how that cookie line came to be parsed as having an empty
    name. Recorded after successfully creating a cookie whose name is empty. Not
    recorded for a cookie line that is rejected at creation due to parsing,
    invalid attributes, or other errors.
  </summary>
  <token key="SourceType">
    <variant name="" summary="any source"/>
    <variant name=".Http" summary="HTTP response headers"/>
    <variant name=".Script" summary="document.cookie in JavaScript"/>
  </token>
</histogram>

<histogram name="Cookie.PartitionCount" units="partitions"
    expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the number of cookie jar partitions. This metric is
    only recorded when partitioned cookies are enabled. This count does not
    include the unpartitioned cookie jar. Only counts cookie jar partitions with
    at least one cookie. This metric is recorded every 10 minutes.
  </summary>
</histogram>

<histogram name="Cookie.PartitionedCookieCount" units="cookies"
    expires_after="2027-01-24">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the number of cookies in the partitioned cookie jar.
    This metric is only recorded when partitioned cookies are enabled. This
    metric is recorded every 10 minutes.
  </summary>
</histogram>

<histogram name="Cookie.PartitionedCookieCount.{NonceType}" units="cookies"
    expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the number of partitioned cookies whose partition key
    is {NonceType}. This metric is only recorded when partitioned cookies are
    enabled. This metric is recorded every 10 minutes.
  </summary>
  <token key="NonceType">
    <variant name="Nonced"/>
    <variant name="Unnonced"/>
  </token>
</histogram>

<histogram name="Cookie.PartitionedCookieJarSizeKibibytes" units="kibibytes"
    expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the size of the names and values of all cookies in
    the partitioned cookie jar. This metric is only recorded when partitioned
    cookies are enabled. This metric is recorded every 10 minutes.
  </summary>
</histogram>

<histogram name="Cookie.PartitionedCookieJarSizeKibibytes.{NonceType}"
    units="kibibytes" expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the size of the names and values of all cookies in
    the partitioned cookie jar, only counting {NonceType} partitions. This
    metric is only recorded when partitioned cookies are enabled. This metric is
    recorded every 10 minutes.
  </summary>
  <token key="NonceType">
    <variant name="Nonced"/>
    <variant name="Unnonced"/>
  </token>
</histogram>

<histogram name="Cookie.PartitionedCookiesInRequest" units="cookies"
    expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records the number of partitioned cookies in requests. Only
    measured for requests that include at least one cookie, partitioned or not.
  </summary>
</histogram>

<histogram name="Cookie.Port.OmniboxURLNavigation.Localhost"
    enum="InterestingCookiePorts" expires_after="2026-03-28">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The port of the destination for a URL omnibox navigation when the
    destination is localhost. Excludes navigations that are effectively reloads.
    Also does not take into account any redirects that destination URL may do
    before finally serving a page. In other words, it's the port of the first
    request in a possible chain. Note that the effective port is recorded which
    includes the default port, so if https://google.com is typed then 443 will
    be recorded.

    Cookie.Port.OmniboxURLNavigation.RemoteHost records the non-localhost
    version of this histogram.

    While the intent of this histogram is to inform cookie related design
    decisions, the metric itself does not depend on cookies being sent or set.
  </summary>
</histogram>

<histogram name="Cookie.Port.OmniboxURLNavigation.RemoteHost"
    enum="InterestingCookiePorts" expires_after="2026-03-18">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The port of the destination for a URL omnibox navigation when the
    destination is anything but localhost. Excludes navigations that are
    effectively reloads. Also does not take into account any redirects that
    destination URL may do before finally serving a page. In other words, it's
    the port of the first request in a possible chain. Note that the effective
    port is recorded which includes the default port, so if https://google.com
    is typed then 443 will be recorded.

    Cookie.Port.OmniboxURLNavigation.Localhost records the localhost version of
    this histogram.

    While the intent of this histogram is to inform cookie related design
    decisions, the metric itself does not depend on cookies being sent or set.
  </summary>
</histogram>

<histogram name="Cookie.Port.Read.{HostType}.Subsampled"
    enum="InterestingCookiePorts" expires_after="2026-03-10">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This is the port a cookie is being read by: For network access via HTTP(S)
    this value is the port of the origin the request is being sent to. For
    script access via non-HTTP APIs this is the value of the port of the origin
    of the frame the read call is made in.

    The &quot;Localhost&quot; variant of this metric is recorded only for
    localhost origns. The &quot;RemoteHost&quot; variant is recorded for all
    other origins.

    This metric is recorded once per included cookie on every read attempt.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
  <token key="HostType">
    <variant name="Localhost"/>
    <variant name="RemoteHost"/>
  </token>
</histogram>

<histogram name="Cookie.Port.ReadDiffersFromSet.{HostType}.Subsampled"
    enum="CookieSentToSamePort" expires_after="2025-12-13">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This records if a cookie is being read by the same port value that set it
    (the source port). See Cookie.Port.Set.* and Cookie.Port.Read.* for more
    information on how the port value for setting and reading (respectively) is
    obtained.

    If the source port is unspecified (due to a cookie already existing before
    we started to record this value) or invalid (due to corruption) then this
    metric does not check for destination port equivalency.

    The &quot;Localhost&quot; variant of this metric is recorded only for
    localhost origns. The &quot;RemoteHost&quot; variant is recorded for all
    other origins. The &quot;DomainSet&quot; variant of this metric is recorded
    for all cookies which have the Domain attribute set (localhost and IP
    addresses cannot set the Domain attribute and therefore will not trigger
    this metric. Put technically, the origin must have a non-empty registrable
    domain to set the Domain attribute).

    This metric is recorded once per included cookie on every read attempt.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
  <token key="HostType">
    <variant name="DomainSet"/>
    <variant name="Localhost"/>
    <variant name="RemoteHost"/>
  </token>
</histogram>

<histogram name="Cookie.Port.Set.{HostType}.Subsampled"
    enum="InterestingCookiePorts" expires_after="2025-08-10">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This is the port a cookie is being set by: For network access via HTTP(S)
    this value is the port of the origin the response is being received from.
    For script access via non-HTTP APIs this is the value of the port of the
    origin of the frame the set call is made in.

    The &quot;Localhost&quot; variant of this metric is recorded only for
    localhost origns. The &quot;RemoteHost&quot; variant is recorded for all
    other origins.

    This metric is recorded once per included cookie on every set attempt. This
    includes expired cookies which are immediately deleted.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
  <token key="HostType">
    <variant name="Localhost"/>
    <variant name="RemoteHost"/>
  </token>
</histogram>

<histogram name="Cookie.RequestSameSiteContext.Subsampled"
    enum="SameSiteCookieContext" expires_after="2025-07-13">
  <owner>morlovich@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The same-site context of a request, i.e. the relationship between the
    request and the navigational environment. Logged on every request to access
    a cookie.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.SameSiteAttributeValue.Subsampled"
    enum="CookieSameSiteString" expires_after="2025-07-27">
  <owner>miketaylr@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The value of the cookie's SameSite attribute, if any. This is logged once
    per created cookie, upon parsing of the SameSite attribute from a string.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.SameSiteNoneSizeBytes.Subsampled" units="bytes"
    expires_after="2027-01-03">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Size of SameSite=None cookies in bytes. Counted whenever a cookie is set via
    CookieMonster::SetCanonicalCookie.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.SameSiteNoneSizeBytes.{IsPartitioned}.Subsampled"
    units="bytes" expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Size of SameSite=None {IsPartitioned} cookies in bytes. Counted whenever a
    cookie is set via CookieMonster::SetCanonicalCookie.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
  <token key="IsPartitioned">
    <variant name="Partitioned"/>
    <variant name="Unpartitioned"/>
  </token>
</histogram>

<histogram name="Cookie.ScriptAgeSinceLastUpdateInHoursGTOneWeek" units="hours"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of hours old a non-session cookie written by a script and being
    loaded for some context is (for values greater than one week). Recorded when
    cookies are loaded from the store.
  </summary>
</histogram>

<histogram name="Cookie.ScriptAgeSinceLastUpdateInHoursLTEOneWeek"
    units="hours" expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of hours old a non-session cookie written by a script and being
    loaded for some context is (for values less than or equal to one week).
    Recorded when cookies are loaded from the store.
  </summary>
</histogram>

<histogram name="Cookie.ScriptExpirationInHoursGTOneWeek.Subsampled"
    units="hours" expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of hours in the future a non-session cookie being set via JavaScript
    wants to expire (for values greater than to one week). Recorded when the
    cookie is stored via script.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.ScriptExpirationInHoursLTEOneWeek.Subsampled"
    units="hours" expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of hours in the future a non-session cookie being set via JavaScript
    wants to expire (for values less than or equal to one week). Recorded when
    the cookie is stored via script.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.SessionAgeSinceLastUpdateInHoursGTOneWeek"
    units="hours" expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of hours old a session cookie being loaded for some context is (for
    values greater than one week). Recorded when cookies are loaded from the
    store. Unlike Cookie.SessionAgeInHoursGTOneWeek this metric records the time
    since the last refresh (if any) instead of initial creation.
  </summary>
</histogram>

<histogram name="Cookie.SessionAgeSinceLastUpdateInHoursLTEOneWeek"
    units="hours" expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Number of hours old a session cookie being loaded for some context is (for
    values less than or equal to one week). Recorded when cookies are loaded
    from the store. Unlike Cookie.SessionAgeSinceLastUpdateInHoursLTEOneWeek
    this metric records the time since the last refresh (if any) instead of
    initial creation.
  </summary>
</histogram>

<histogram name="Cookie.SetCookieContainsPartitioned" enum="Boolean"
    expires_after="2027-02-07">
  <owner>dylancutler@google.com</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    This histogram records if a Set-Cookie header resulted in a partitioned or
    unpartitioned cookie. Only recorded if the header resulted in a valid
    cookie. This allows us to estimate what percentage of Set-Cookie headers
    contain the Partitioned attribute.
  </summary>
</histogram>

<histogram name="Cookie.SourceType.Subsampled" enum="CookieSourceType"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    For each cookie added to the store, record the source that wrote it. This
    helps understand the balance of cookies written by HTTP Headers, JavaScript,
    etc.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram
    name="Cookie.SQLitePersistentCookieStore.Backend.LoadAndNotifyInBackground.First"
    units="ms" expires_after="2027-01-24">
  <owner>yoichio@chromium.org</owner>
  <owner>chrome-loading@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    The amount of time taken to load cookies from the SQLite database and notify
    the caller. This is recorded on a background thread during the initial load
    of the persistent cookie store, specifically for the first time this
    operation is called (which is usually the full load or the first keyed
    load).
  </summary>
</histogram>

<histogram
    name="Cookie.SQLitePersistentCookieStore.Backend.LoadAndNotifyInBackground2"
    units="ms" expires_after="2027-01-24">
  <owner>yoichio@chromium.org</owner>
  <owner>chrome-loading@google.com</owner>
  <improvement direction="LOWER_IS_BETTER"/>
  <summary>
    The amount of time taken to load cookies from the SQLite database and notify
    the caller. This is recorded on a background thread during the initial load
    of the persistent cookie store.
  </summary>
</histogram>

<histogram name="Cookie.StaleSessionCookiesDeletedOnStartup" units="cookies"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    Records the amount of stale (7 days since last access or update) session
    cookies deleted by SessionRestore after tabs have been restored on browser
    startup.

    See crbug.com/40285083 for more info.
  </summary>
</histogram>

<histogram name="Cookie.TimeBlockedOnLoad" units="ms"
    expires_after="2027-01-03">
  <owner>wfh@chromium.org</owner>
  <summary>
    The amount of time (ms) between the cookie store load starting and
    completing.
  </summary>
</histogram>

<histogram name="Cookie.TimeDatabaseMigrationToV24" units="ms"
    expires_after="2027-03-10">
  <owner>arichiv@chromium.org</owner>
  <owner>wfh@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The amount of time (ms) to migrate a v23 cookie database to v24. Migration
    occurs upon first startup of a browser version with v23 database code.
  </summary>
</histogram>

<histogram name="Cookie.TimeInitializeDB" units="ms" expires_after="2027-01-03">
  <owner>cfredric@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>The amount of time (ms) to initialize the cookies database.</summary>
</histogram>

<histogram name="Cookie.TimeOpsBlockedDueToGlobalOp" units="ms"
    expires_after="2027-02-21">
  <owner>morlovich@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The amount of time (ms) cookie operations are blocked due to a global
    operation happening on startup. 0 if this didn't happen.

    Recorded after all cookies finished loading from disk for a given cookie
    store.
  </summary>
</histogram>

<histogram name="Cookie.TimeToRecordPeriodicStats" units="ms"
    expires_after="2025-05-04">
  <owner>cfredric@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The amount of time (ms) to record periodic statistics for logging. This
    metric is recorded every 10 minutes.
  </summary>
</histogram>

<histogram name="Cookie.Type2.Subsampled" enum="CookieType"
    expires_after="2027-03-31">
  <owner>arichiv@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    For each cookie added to the store, record it's type(s). A new enumeration
    value, Persistent, was added in M125.

    Subsampled to 1/1000. See kHistogramSampleProbability in
    net/cookies/cookie_constants.h for details.
  </summary>
</histogram>

<histogram name="Cookie.WinGetLastErrorInitializeDB" enum="WinGetLastError"
    expires_after="2024-05-19">
  <owner>wfh@chromium.org</owner>
  <owner>src/net/cookies/OWNERS</owner>
  <summary>
    The result of calling ::GetLastError if initializing the cookies database
    fails catastrophically. Initializing the cookies database happens once per
    network context configured with persistent cookies, so this metric could be
    reported multiple times from the same client. Catastrophic errors are
    defined in sql::IsErrorCatastrophic. This metric is only reported on
    Windows.
  </summary>
</histogram>

</histograms>

</histogram-configuration>
