INTEGRITY Documentation

Dynamic content and login issues

Dynamic pages such as login forms, checkout flows, and authenticated application routes can break when they are cached too aggressively.

Common symptoms include:

Cached login page strips session cookies

One common cause is a Cache Rule or legacy Page Rule configured to cache dynamic HTML.

This usually happens when all of the following are true:

In this configuration, Cloudflare can cache the response and remove the Set-Cookie header before the response is stored at the edge. As a result, the browser receives the login page but never gets the session cookie required for the next request.

How to confirm

Check the response for the login page or other dynamic route.

If you see both of the following, the page is probably cached when it should not be:

You may also see framework-specific failures after form submission, for example:

This issue is common with frameworks that rely on a session or CSRF cookie on the first page load, including JavaServer Faces, ASP.NET, PHP session handlers, Django, Rails, and Laravel.

Resolution

Do not cache login pages or other authenticated HTML.

Instead:

  1. Restrict Eligible for cache or Cache Everything to static paths only.
  2. Add a more specific Cache Rule that bypasses or disables caching for routes such as /login, /account, /cart, /checkout, and application API paths.
  3. If the origin must control caching, remove any Edge TTL override that forces the page to be cached.
  4. Verify the fixed response now returns CF-Cache-Status: DYNAMIC, MISS, or BYPASS, and preserves Set-Cookie.

For more information on cookie behavior, refer to Interaction of Set-Cookie response header with Cache.

Challenge loops on login or form flows

Security challenges can also interrupt dynamic flows.

Two common patterns are:

How to confirm

Check whether a WAF custom rule, managed rule, or rate limiting rule applies to the login path.

If the issue only affects routes such as /login, /signin, /checkout, or /api/auth/*, and the application works when the challenge is disabled for those paths, the challenge is likely interrupting the flow.

Resolution

Use one of the following approaches:

  1. Exclude the login or form submission path from the challenge rule.
  2. Narrow the rule expression so it applies to suspicious traffic only.
  3. If you must protect the route, use a less disruptive control on the page load and apply stronger actions elsewhere in the flow.

When debugging, also verify that rules are not matching Cloudflare-generated paths such as /cdn-cgi/*.

For more information on challenge-related behavior, refer to Rules troubleshooting and Cloudflare WAF troubleshooting.