Functionality cookie · Stripe

__stripe_mid Cookie: What It Is, Who Sets It, and Consent Rules

Last verified 2026-10-17 · Updated 2026-10-17

On this page
  1. What the __stripe_mid cookie does
  2. Who sets the __stripe_mid cookie
  3. Does the __stripe_mid cookie need consent?
  4. How to block the __stripe_mid cookie
  5. How long the __stripe_mid cookie lasts
  6. Cookies that work with __stripe_mid
  7. Scripts and requests of Stripe
  8. __stripe_mid cookie FAQs

What the __stripe_mid Cookie Does on Your Site

The __stripe_mid cookie is a first-party functionality cookie that Stripe.js sets on your domain to help Stripe detect fraud across the visits of the same browser. Stripe sets the __stripe_mid cookie "for fraud prevention purposes", and the cookie helps Stripe "assess the risk associated with an attempted transaction", according to the Stripe cookie settings page. Stripe.js writes an ID into the __stripe_mid cookie and sends fraud signals to the m.stripe.com endpoint of Stripe. Stripe uses the fraud signals for fraud detection, and the data is "never used for advertising", according to the Stripe documentation on advanced fraud detection.

The __stripe_mid cookie works with the __stripe_sid cookie. The __stripe_mid cookie follows the browser for 1 year (365 days), and the __stripe_sid cookie covers a single visit of 30 minutes.

__stripe_mid cookie facts
Cookie name__stripe_mid
VendorStripe
CompanyStripe, Inc.
CategoryFunctionality
PartyFirst-party
DomainYour own root domain, for example example.com
Set byJavaScript, through Stripe.js from js.stripe.com
Retention1 year (365 days)
Value example3b8f1c2d-4e5a-4b6c-8d7e-9f0a1b2c3d4e5f6a7b
HttpOnlyNo
SecureYes
SameSiteStrict
Cookie Consent categoryfunctionality
Privacy Consent vendor categoryFunctionality (functionality)

Who Sets the __stripe_mid Cookie

Stripe.js sets the __stripe_mid cookie with JavaScript on the root domain of the page that loads Stripe.js. Stripe recommends that you "include this script on every page, not just the checkout page", according to the Stripe.js reference, so a shop that follows the advice sets the __stripe_mid cookie on every page.

A TermsFeed check in Chrome on 17 October 2026 found the __stripe_mid cookie with Secure and SameSite=Strict. The value held a random ID in the format of a UUID followed by 6 more hexadecimal characters. Stripe.js loaded a fraud signals frame from js.stripe.com at the same time.

Read how Stripe, Inc. handles the data in the Stripe privacy policy, and sign the Stripe Data Processing Agreement before you collect data from visitors in the EU or the UK. Both documents appear in the sources at the end of this page.

How to Block the __stripe_mid Cookie Until Visitors Accept

Block the __stripe_mid cookie by holding back Stripe.js until the visitor accepts functionality cookies. TermsFeed Free Cookie Consent and TermsFeed Privacy Consent place Stripe in the functionality category. Check whether an exemption applies to your own use of Stripe in the consent rules for the __stripe_mid cookie.

Stripe.js writes no __stripe_mid cookie while Stripe.js waits as a tagged script. Leave Stripe.js untagged on the payment page itself, because the payment form needs Stripe.js to take the payment.

Block the __stripe_mid Cookie With TermsFeed Free Cookie Consent

TermsFeed Free Cookie Consent runs a tagged script only after the visitor accepts its category. Change type="text/javascript" to type="text/plain" and add data-cookie-consent="functionality", the Cookie Consent category for functionality cookies. The tagged Stripe.js looks like this.

<script type="text/plain" data-cookie-consent="functionality" src="https://js.stripe.com/endive/stripe.js"></script>

Cookie Consent runs the tagged code after the visitor clicks "I agree" or accepts the functionality category in the Preferences Center. The illustration shows the consent banner and the script it releases.

The TermsFeed Free Cookie Consent banner: (1) the visitor clicks "I agree", (2) Cookie Consent runs the script tagged functionality. Illustration of the consent banner.

Cookie Consent is free and needs no account. Build your free consent banner with TermsFeed Free Cookie Consent.

Block the __stripe_mid Cookie With TermsFeed Privacy Consent

Add Stripe from its template in TermsFeed Privacy Consent, and Stripe.js loads on the pages outside checkout only after the visitor accepts the Functionality vendor category. Your payment pages keep loading Stripe.js directly, because the payment form needs Stripe.js to take the payment.

The template checks whether the page already holds Stripe.js and loads Stripe.js once, so the template never adds a second copy to a payment page.

The Stripe template asks for no ID and fills every field of the vendor. Pick the "Stripe" card under Functionality and click "Add Stripe". The illustration shows the template form in the TermsFeed app.

The Stripe template in TermsFeed Privacy Consent: (1) pick the card, (2) click "Add Stripe". Illustration of the TermsFeed app.

Privacy Consent detects the location of each visitor and records every answer in a consent log. Set up Stripe from its template with TermsFeed Privacy Consent.

Stop the __stripe_mid Cookie in the Stripe.js Settings

Load Stripe.js with advancedFraudSignals set to false to stop the __stripe_mid cookie on your domain. Add ?advancedFraudSignals=false to the URL of the Stripe.js script, or call loadStripe.setLoadParameters({advancedFraudSignals: false}) from @stripe/stripe-js/pure before you load Stripe.js.

A TermsFeed check in Chrome on 17 October 2026 found no __stripe_mid and no __stripe_sid cookie after a load with advancedFraudSignals=false. Stripe "will continue to collect fraud detection risk factors on Stripe domains", according to the Stripe documentation on advanced fraud detection.

How to Verify That the __stripe_mid Cookie Waits for Consent

Verify the setup in a private window. Open Chrome DevTools, select the Application tab, and open Cookies. Click "I decline" on the consent banner and reload the page. The __stripe_mid cookie must not appear in the list until you accept functionality cookies.

How Long the __stripe_mid Cookie Lasts

The __stripe_mid cookie lasts 1 year (365 days). Safari caps the cookies that JavaScript sets at 7 days of Safari use without an interaction with your site, according to the WebKit team behind Safari.

The __stripe_mid cookie lasts 1 year (365 days), according to the Stripe cookie settings page, and a TermsFeed check in Chrome on 17 October 2026 measured the same expiry.

Scripts and Requests of Stripe That Come With the __stripe_mid Cookie

The catalog lists 2 scripts, pixels, and data endpoints of Stripe, which a cookie scanner or the Network tab of Chrome DevTools shows next to the __stripe_mid cookie. Block the main script, and the requests in the table stop with the main script.

TypeResourceHostWhat it does
ScriptStripe.jsjs.stripe.comStripe.js loads the Stripe payment elements and writes the __stripe_mid and __stripe_sid cookies unless advancedFraudSignals is false.
IframeStripe fraud signals frame (m-outer)js.stripe.comThe fraud signals frame of Stripe.js collects the signals that Stripe sends with the ID from the __stripe_mid cookie.

__stripe_mid Cookie FAQs

Is __stripe_mid a necessary cookie?

No, the __stripe_mid cookie is not a strictly necessary cookie on the pages outside your payment page. Firstly, Stripe.js on every page collects fraud signals from visitors who never start a payment. Secondly, Stripe offers the advancedFraudSignals setting, which stops the cookie while Stripe.js still takes payments. Thirdly, the TermsFeed Privacy Consent template for Stripe loads Stripe.js outside checkout only after the visitor accepts the Functionality vendor category.

What is the difference between __stripe_mid and __stripe_sid?

The __stripe_mid cookie identifies the browser for 1 year, and the __stripe_sid cookie identifies a single visit for 30 minutes. Stripe uses both cookies for fraud prevention, according to the Stripe cookie settings page.

Can I turn off the __stripe_mid cookie?

Yes, the advancedFraudSignals setting of Stripe.js turns off the __stripe_mid cookie. Firstly, Stripe.js writes neither Stripe cookie on your domain while advancedFraudSignals is false, set in the URL of the script or in loadStripe.setLoadParameters(). Secondly, Stripe documents the setting as an opt-out from advanced fraud signals, not from payments. Thirdly, Stripe encourages Stripe.js on every page of the shopping experience for its fraud detection, according to the Stripe documentation on advanced fraud detection. Weigh the fraud protection you give up before you turn the setting off.

Why does __stripe_mid appear on pages without a payment form?

Stripe.js sets the __stripe_mid cookie on every page that loads Stripe.js, and Stripe recommends loading Stripe.js on every page. A payment plugin that adds Stripe.js to the whole site therefore sets the __stripe_mid cookie on the home page and the blog as well as on the checkout.

Sources for the __stripe_mid Cookie

The facts on this page come from the documentation Stripe publishes, checked on 2026-10-17. The catalog lists every source so you check each fact yourself.