Resource Load Statistics: Make it possible exclude localhost from classification
[WebKit-https.git] / LayoutTests / http / tests / resourceLoadStatistics / resources / set-cookie-on-redirect.php
1 <?php
2 if ($_GET['step'] == 1) {
3   header("HTTP/1.0 302 Found");
4   header('Location: http://localhost:8000/cookies/resources/set-cookie-on-redirect.php?step=2');
5 } else if ($_GET['step'] == 2) {
6   header("HTTP/1.0 302 Found");
7   setcookie("test_cookie", "1", time() + 86400);
8   header('Location: http://localhost:8000/cookies/resources/set-cookie-on-redirect.php?step=3');
9 } else if ($_GET['step'] == 3) {
10   header("HTTP/1.0 200 OK");
11   if (isset($_COOKIE['test_cookie'])) {
12     /* Clear cookie in order not to affect other tests. */
13     setcookie("test_cookie", "", time() - 86400);
14
15     echo "PASSED: Cookie successfully set\n";
16   } else {
17     echo "FAILED: Cookie not set\n";
18   }
19   echo "<script src='util.js'></script>";
20   echo "<script>if (window.testRunner && window.internals) setEnableFeature(false, finishJSTest);</script>";
21 }
22 ?>