Redirecting Traffic

Is it possible I can use Cloudflare to insert a cookie into a users browsers then redirect that traffic into another link based on their IP address or cookie in their browser?

I do see the redirect rules, but little confused on how this works. Would I use PHP to set the cookie or can I set cookies somehow in Cloudflare? Is cloudflare able to read the cookies in the browser from PHP?

You can redirect based on IP and cookie using the ruleset engine.

You can set the cookie in PHP or using a transform rule from Cloudflare

Cloudflare is able to read the cookies for an inbound request. See Fields reference · Cloudflare Ruleset Engine docs

Could you clarify on how to set the cookie using transform rule.

I don’t see anywhere in the transform rule where it says “create cookie” or “set cookie” or anything like that?

You have to manually use the set cookie header. See the example in

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.