chromium/third_party/blink/web_tests/http/tests/cookies/partitioned-cookies/resources/redirect-and-append-cookie-header.php

<?php
  header("Access-Control-Allow-Origin: *");

  // Extract the cookie information.
  $headers = getallheaders();
  $cookieHeader = $headers['Cookie'];

  // Append the cookieHeader to the destination url
  // as a query parameter.
  $url = $_GET['location'];
  $urlWithQuery = $url . "?cookie=" . strval($cookieHeader);

  // Perform the redirect.
  header("Location: $urlWithQuery", TRUE, 302);
?>