Cookies and cache - Sharing cookie values?

Hi!
I our sites, we define affiliation cookies taking into account the referrer of the request (If it comes from a partner, we set up a cookie, and the activity of the customer gets tracked with that). My question is, if a page is cached via Cloudflare caching, are the cookies also cached along with the page?
For instance, customer A have cookie value A. Customer B goes into the page customer A has visited before and he gets a cached version, is it possible that customer B gets the cookie from customer A?

Response from support:

Cloudflare will not cache when there is a cookie in responses unless you enforce Edge cache TTL to overwrite the behavior. If that’s the case, Cloudflare will cache even cookies are there, hence, same cookies would be delivered for every user.

Hi,

Do u mean to say if in page rule cache everything is enabled, and on that page there is google ads; First user on the edge and its cookie will be cached (even the ad cookies?)

According to the response given by support, that could happen.

But that would be so wrong for any website.

1 Like

The wording says that would only happen if you set Edge Cache TTL in the Page Rule.

I asked then to support if Cache Everything would do the same, and they said this:

Hi there,

As we mentioned before, Edge cache TTL setting and “Cache everything” are both in place will lead to this behavior. For more information about caching, you can refer to this article for clarification:

How Do I Tell Cloudflare What to Cache?

Hope this clarifies, please feel free to reach out if you have further questions.

So, I guess it’s Edge Cache TTL and Cache Everything.

1 Like

But Cache everything should cache everything related to the domain it is set to. if example.com use Edge cache TTL and all the cookie related to example.com should cache (one can bypass using cookie in business plan). But cookie which are outside example.com e.g. AD script code and cookie should not get cached.

That is a very good point. I’m not sure what would happen.

This topic was automatically closed after 30 days. New replies are no longer allowed.