Code Component SSR

Questions

  1. Can we access HttpOnly cookies

    • e.g. User Accounts UserID in token

  2. Can we access Http Response headers

    • e.g. Reverse proxy headers

Research findings

  1. No, by design.

  2. Yes, by client-side JS fetch

    1. Inefficient

    2. Won't be the exact current page response

      1. but similar

Notes

Webflow does not expose the request object to Code Components during SSR.

Here's what we learned:

  • ✅ Components DO run SSR in Cloudflare Workers

  • ❌ No props are passed with request context

  • ❌ No global request object is available

  • ❌ HttpOnly cookies are inaccessible (by design)

  • ✅ Client-side fetch CAN get response headers (18 found!)

The limitation: In Cloudflare Workers SSR, the request object exists at the worker's fetch handler level, but Webflow doesn't expose it to individual React components. This is likely intentional - components are meant to be stateless and cacheable.

What the component CAN do:

  • ✅ Show response headers via client-side fetch

  • ✅ Show non-httpOnly cookies from document.cookie

SSR Environment

typeof window
undefined

typeof global

object

typeof process

object

Global Objects

globalThis keys

navigator, global, process, Buffer, origin, Cloudflare, performance, scheduler, caches, crypto, self, ServiceWorkerGlobalScope

Cloudflare object

No Request object exposed.

Last updated