Prompt

I need edge functions that can inspect headers and cookies

Technology / CDN & Edge Infrastructure1 observationLast seen Oct 26, 2026

Latest observation

Oct 26, 2026OpenAI APIWeb search: off

Yes — edge functions can inspect both request headers and cookies.

What they can access

In most edge runtimes, you can read:

  • Headers from the incoming request
  • Cookies from the request headers, usually via the Cookie header
  • Sometimes also set response headers/cookies

Example logic

If you're using a fetch-style edge function:

export default {
  async fetch(request) {
    const headers = request.headers;
    const cookieHeader = headers.get("cookie") || "";

    return new Response(JSON.stringify({
      userAgent: headers.get("user-agent"),
      cookies: cookieHeader
    }), {
      headers: { "content-type": "application/json" }
    });
  }
};

If you want parsed cookies

You can manually parse the Cookie header:

function parseCookies(cookieHeader) {
  return Object.fromEntries(
    cookieHeader.split(";").map(cookie => {
      const [name, ...rest] = cookie.trim().split("=");
      return [name, rest.join("=")];
    }).filter(([name]) => name)
  );
}

Things to keep in mind

  • Cookie availability depends on the request actually including them
  • HttpOnly cookies are still visible to the server/edge function
  • Secure cookies only arrive over HTTPS
  • Cross-site requests may omit cookies depending on SameSite

If you tell me which platform you mean by “edge functions” — for example Cloudflare Workers, Vercel Edge Functions, Netlify Edge, or Supabase Edge Functions — I can give you the exact code for that environment.

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (1 observation for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.