+
+$section = "distinct clients";
+
+server("cookie.inc", function($port) use($request, $tmpfile) {
+ $request->setOptions(array("port" => $port));
+ $client = new http\Client;
+ send_and_check($client, ["counter" => 1]);
+});
+server("cookie.inc", function($port) use($request, $tmpfile) {
+ $request->setOptions(array("port" => $port));
+ $client = new http\Client;
+ send_and_check($client, ["counter" => 1]);
+});
+server("cookie.inc", function($port) use($request, $tmpfile) {
+ $request->setOptions(array("port" => $port));
+ $client = new http\Client;
+ send_and_check($client, ["counter" => 1]);
+});
+
+$section = "reusing curl handles";
+
+server("cookie.inc", function($port) use($request, $tmpfile) {
+ $request->setOptions(array("port" => $port));
+ $client = new http\Client("curl", "test");
+ send_and_check($client, ["counter" => 1]);
+});
+server("cookie.inc", function($port) use($request, $tmpfile) {
+ $request->setOptions(array("port" => $port));
+ $client = new http\Client("curl", "test");
+ send_and_check($client, ["counter" => 2]);
+});
+server("cookie.inc", function($port) use($request, $tmpfile) {
+ $request->setOptions(array("port" => $port));
+ $client = new http\Client("curl", "test");
+ send_and_check($client, ["counter" => 3]);
+});
+
+$section = "distict client with persistent cookies";
+