Have you tried setting the domain of the cookies to your API URL, e.g.:
ctx.SetCookie(..., "/", "api.azurecontainerapps.io", true, true)