Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / cookies / resources / cookie-utility.php
bloba33e7ac777678f1198ab5fa90ca10ccbb93128f3
1 <?php
2 parse_str($_SERVER["QUERY_STRING"]);
4 function deleteCookie($value, $name)
6 setcookie($name, "deleted", time() - 86400, '/');
9 if ($queryfunction == "deleteCookies") {
10 array_walk($_COOKIE, deleteCookie);
11 echo "Deleted all cookies";
12 return;
15 if ($queryfunction == "setFooCookie") {
16 setcookie("foo", "awesomevalue", time() + 86400, '/');
17 echo "Set the foo cookie";
18 return;
21 if ($queryfunction == "setFooAndBarCookie") {
22 setcookie("foo", "awesomevalue", time() + 86400, '/');
23 setcookie("bar", "anotherawesomevalue", time() + 86400, '/');
24 echo "Set the foo and bar cookies";
25 return;
28 // Default for any other string is echo cookies.
29 function echoCookie($value, $name)
31 echo "$name = $value\n";
34 function echoAllCookies()
36 echo "Cookies are:\n";
37 array_walk($_COOKIE, echoCookie);