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";
15 if ($queryfunction == "setFooCookie") {
16 setcookie("foo", "awesomevalue", time() +
86400, '/');
17 echo "Set the foo cookie";
21 if ($queryfunction == "setFooAndBarCookie") {
22 setcookie("foo", "awesomevalue", time() +
86400, '/');
23 setcookie("bar", "anotherawesomevalue", time() +
86400, '/');
24 echo "Set the foo and bar cookies";
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
);