Confusion about cross domain cookies and fly

I posted about this a while back (Posthog cookies showing up on fly hosted site) and its clear its not supposed to be happening, but it is!

The cookie name:
ph_phc_Tbfg4E********************************_posthog

The decoded cookie content:

{"distinct_id":"18af765b3e1e85-***","$device_id":"18af765***","$user_state":"anonymous","$sesid":[1696367752242,"18af765b4322e43-099de4418b80338-3e626a4b-5eec00-18af765b4336cd4",1696367752242],"$session_recording_enabled_server_side":false,"$autocapture_disabled_server_side":false,"$active_feature_flags":[],"$enabled_feature_flags":{},"$feature_flag_payloads":{}}

It’s a secure cookie, set for for my app’s domain (Which is hosted on fly), with Lax same site policies.

I don’t have posthog libraries anywhere in my app bundle, so the only other thing that could set this would be fly, which injects other headers into the app on every request (on top the fact fly uses posthog for some thing apparently). I never catch the set cookie header doing it, but this does seem to be happening with html content being served with fly. After clearing the cookie, it shows up again a few days later during normal use of the hosted app.

Anyone else serving html pages off fly seeing this?

Just to be clear, we will never inject cookies or tracking data into customer apps. We do alter headers when routing through our proxy (eg X-Forwarded-*) and add (but never alter) Fly-* headers to assist with end-user debugging and tracing. We did run a self-hosted posthog instance ~2-3 years ago to stress test our then-new postgres product, but we abandoned it shortly after and have not used any posthog tracking since. So like you, we have no posthog code in production.

My guess is either a library is adding these without telling you, or 3rd party js served from your site is. But I’d need to see the domain to know for sure. Are you able to share that?

We did run a self-hosted posthog instance ~2-3 years ago to stress test our then-new postgres product, but we abandoned it shortly after and have not used any posthog tracking since. So like you, we have no posthog code in production.

Ah ok, thank you for clarifying.

My guess is either a library is adding these without telling you, or 3rd party js served from your site is.

The only external code running in the site context that I can think of is my 1Password and Wipr safari browser extensions.

But I’d need to see the domain to know for sure. Are you able to share that?

The app is live at https://breadcrum.net

It’s coming from your status page - https://status.breadcrum.net/

Thanks for the help and sorry for the confusion. I forgot that lived in the same domain. I’ll make some adjustments.

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