cf_clearance Cookie Explained: What Cloudflare Stores
The cf_clearance cookie explained from Cloudflare's docs: clearance levels, lifetime, Precursor, Turnstile pre-clearance, attributes, and what it's tied to.

The cf_clearance cookie is Cloudflare's record that a visitor passed its client-side checks. Cloudflare's own definition is short: the cookie "proves to Cloudflare that the visitor is a verified human and has passed Cloudflare's client-side verifications", and while it's valid, no further challenge is shown. What it actually contains, which challenges it lets you skip, how long it survives and why it stops working on another machine are spread across half a dozen Cloudflare doc pages. This guide pulls them together, quoting the docs as read on 23 November 2026.
It's written for two readers: site owners deciding how long clearance should last, and developers whose own legitimate clients keep getting challenged. If your problem is specifically a challenge that returns right after you solve it, our troubleshooting guide on CAPTCHAs that keep coming back goes deeper on that.
The short answer
| Question | Answer from Cloudflare's docs |
|---|---|
| What sets it? | Solving a challenge page, Turnstile with pre-clearance, JavaScript Detections, or Precursor |
| What does it hold? | Challenge clearance (with a level), Precursor clearance, and the JavaScript Detections outcome, encrypted |
| How long does it last? | 30 minutes by default (Challenge Passage); Cloudflare recommends 15 to 45 minutes |
| Can it end early? | Yes, if Precursor in Armed mode decides the session is suspicious |
| Maximum size | 4,096 bytes |
| Attributes | `SameSite=None; Secure; Partitioned` |
| Portable? | No: "securely tied to the specific visitor and device it was issued to, preventing reuse across machines" |
Scraping at scale? Skip the blocks.
Fast, unblockable datacentre proxies with unlimited bandwidth.
Clearance levels: which challenges it skips
Each challenge type grants a clearance level, and a higher level covers everything below it:
| Clearance level | Skips |
|---|---|
| Interactive (high) | Interactive, Managed and Non-Interactive challenges |
| Managed (medium) | Managed and Non-Interactive challenges |
| Non-Interactive (low) | Non-Interactive challenges only |
So a visitor who passed a Non-Interactive (JavaScript) challenge and then hits a rule that issues a Managed Challenge gets challenged again, even with a valid cookie. Solving the higher challenge replaces the old clearance. This explains a common "but I have the cookie" report: the cookie is valid, just not at the level the new rule asks for.
How long cf_clearance lasts
The lifetime is the zone's Challenge Passage setting. Cloudflare's docs: "By default, the cf_clearance cookie has a lifetime of 30 minutes. Cloudflare recommends a setting between 15 and 45 minutes." Site owners change it under Security > Settings > Challenge passage.
Three details from the same page matter in practice:
- Clock skew allowance. When Cloudflare evaluates the cookie, "a few extra minutes are included to account for clock skew".
- An extra hour for XHR. "For XmlHTTP requests, an extra hour is added to the validation time to prevent breaking XmlHTTP requests for pages that set short lifetimes." A single-page app's background calls keep working a while after the page itself would be re-challenged.
- Rate limiting ignores it. "The Challenge Passage does not apply to rate limiting rules." A valid clearance won't save a client from a rate-limit block.
Turnstile pre-clearance cookies use the same zone-level Challenge Passage value.
Precursor: clearance that can be revoked mid-session
Precursor is Cloudflare's newer session-based verification. A client-side script runs throughout the visit, collects signals, and in Armed mode its results "can update session state stored in the cf_clearance cookie". In Monitor mode it collects signals without changing bot scores or clearance; Off disables it.
That changes the old mental model. Challenge clearance used to be purely time-bound. With Precursor armed, Cloudflare's docs say clearance is "both time-bound (Interstitial) and behavior-bound (Precursor)": if a session looks suspicious, effective clearance "may be reduced or invalidated" and the visitor "may be re-challenged, even if the cookie has not expired".
Precursor can also show a lightweight Precursor Interstitial to establish a verified session. Site owners can turn that on site-wide or per path (for example only on /checkout) with Interstitial Rules, which matters for APIs: non-browser clients and browser calls that don't send cookies can't complete it. Cloudflare's guidance for browser code is to always send credentials on same-site API calls (fetch(url, { credentials: "include" }) or axios withCredentials: true) so the clearance cookie travels with them.
Turnstile pre-clearance
By default, solving a Turnstile widget produces a single-use token that your server must validate with Siteverify, and no cookie. With pre-clearance enabled, Turnstile also issues a cf_clearance cookie, so a visitor who solved the widget on a login page isn't challenged again by WAF rules elsewhere on the same zone, API calls included.
The widget's clearance_level sets how much the cookie covers:
| `clearance_level` | Cookie skips |
|---|---|
| `interactive` | Non-Interactive, Managed and Interactive challenge rules |
| `managed` | Non-Interactive and Managed challenge rules |
| `jschallenge` | Non-Interactive challenge rules |
| `no_clearance` (default) | no cookie issued |
Pre-clearance is off by default, and it only works when the widget's hostname matches the zone that carries the WAF rules. The token still has to be validated server-side; pre-clearance adds the cookie, it doesn't replace Siteverify. For how the Turnstile widget itself behaves from an automation client's point of view, see our Cloudflare Turnstile guide.
When a site sets cf_clearance, and when it doesn't
A cf_clearance cookie isn't part of every Cloudflare page view. It appears when the zone actually runs one of the mechanisms above: a challenge page, JavaScript Detections, Turnstile with pre-clearance, or Precursor. We checked our own Cloudflare-fronted site, www.sparkproxy.io, on 23 November 2026 with Chrome 157 in headed and headless mode: both visits returned 200, served through Cloudflare (Server: cloudflare, a CF-RAY header), and neither set a cf_clearance cookie, because the zone wasn't challenging that traffic.
So the cookie's absence doesn't mean a site isn't on Cloudflare, and its presence tells you the zone runs some form of client-side verification. To tell which protection a site uses in the first place, see how to identify which anti-bot a site uses.
Settings for site owners
If you run a Cloudflare zone, these are the levers that decide how cf_clearance behaves for your visitors:
- Challenge Passage length. Stay in Cloudflare's 15 to 45 minute band for most sites. Longer means fewer interruptions and a longer window for a stolen cookie.
- Match challenge types to the clearance you want. If one rule uses a Managed Challenge and another a JavaScript challenge, visitors with low-level clearance get challenged again on the stricter rule.
- JavaScript Detections rules. Build WAF rules on
cf.bot_management.js_detection.passed, but Cloudflare warns it "should never be used in a WAF custom rule that matches a visitor's first request", because detection needs at least one HTML page load first. - Rate limit by clearance. With Advanced Rate Limiting, use the Clearance UUID characteristic and the expression
http.request.clearance.uuid ne "", so requests without a cookie don't all share one empty-value counter; rate-limit those separately by IP. - Precursor for mixed sites. Keep the Precursor Interstitial off by default and require it on sensitive paths, or on by default and off for API hostnames, so
curl, mobile backends and server-to-server jobs aren't stuck behind a browser-only challenge. - Turnstile pre-clearance. Enable it on the widget, set a
clearance_level, and make sure the widget hostname matches the zone.
Frequently asked questions
FAQ
cf_clearance is the cookie Cloudflare sets after a visitor passes a challenge or its client-side checks. It stores encrypted challenge clearance (with a level), Precursor session clearance and the JavaScript Detections result, and while it's valid Cloudflare doesn't show another challenge at or below that level.
30 minutes by default. Site owners set it with the Challenge Passage setting, and Cloudflare recommends 15 to 45 minutes. Validation allows a few extra minutes for clock skew and an extra hour for XHR requests, and Precursor in Armed mode can invalidate clearance earlier.
Cloudflare says the cookie is "securely tied to the specific visitor and device it was issued to, preventing reuse across machines", without publishing the exact inputs. In practice a cookie moved to a different device, browser or network is treated as invalid and the visitor is challenged again.
It's an encrypted string that only Cloudflare can read. It changes during a session as Precursor and JavaScript Detections update it, which is why Cloudflare offers the stable Clearance UUID (http.request.clearance.uuid) for rate-limiting rules. The cookie can't exceed 4,096 bytes.
An optional Turnstile setting that issues a cf_clearance cookie when a visitor solves the widget, in addition to the usual single-use token. The widget's clearance_level (interactive, managed, jschallenge or no_clearance) decides which WAF challenges the cookie lets the visitor skip on the same zone.
The usual reasons are a lower clearance level than the new rule requires, Precursor revoking clearance mid-session, an expired Challenge Passage, a rate-limiting rule (which ignores clearance), or the cookie not being sent at all, for example from a fetch call without credentials: "include".
Get 20% off your first month
Premium datacentre proxies with unlimited bandwidth. Use the code at checkout.
Save up to 15% more on quarterly, half-yearly and yearly plans
Related articles

Web Bot Auth: Sign Your Agent's HTTP Requests
Web Bot Auth explained and implemented: Ed25519 keys, the key directory, RFC 9421 signatures in Python and Node, who verifies them, and the header format trap.

Browser Does Not Support SOCKS5 Proxy Auth: Fix
Fix Playwright's 'Browser does not support socks5 proxy authentication' and Puppeteer's ERR_NO_SUPPORTED_PROXIES: why Chromium can't, and three tested fixes.

Turnstile Token Missing, Rejected or Expired: Fixes
Fix Turnstile token errors on your own forms: missing-input-response, invalid-input-response, timeout-or-duplicate, the 300-second rule and test keys.
