Clarification on cookie forwarding behavior for rewrites/proxies

I’d like to request clarification on whether Netlify forwards cookies for rewrites/proxies to a third-party service.

Suppose my app is served from https://my-app.com, and I configure https://my-app.com/third-party-service/* to proxy to https://third-party-service.com/* using the following netlify.toml snippet:

[[redirects]]
  from = "/third-party-service/*"
  to = "https://third-party-service.com/:splat"
  status = 200

If my app has cookies for my-app.com with no path restriction, then the browser will of course include them when requesting paths under https://app.my-app.com/third-party-service/*. My question is, what will Netlify do with the cookies? Will it forward them when proxying to https://third-party-service.com/:splat, or strip them off?

The documentation (Rewrites and proxies | Netlify Docs) doesn’t mention what the behavior is.

@AndrewK both my-app.com and third-party-service.com are active websites, neither of which are yours or served by Netlify. Please place domains you don’t want linked to inside backticks `` and/or use example.com as a placeholder.

As far as sending of cookies through a proxy, I don’t believe that happens.

The cookies will be passed along. We don’t do anything with those.

1 Like

That’s very helpful to know, thank you!

How does Netlify know the existence of a cookie (or cookies) specific to the proxied service that needs passing along?

We don’t. We pass along all cookies sent with a request.