11 include "helper/server.inc";
20 $tmpfile = tempnam(sys_get_temp_dir(), "cookie.");
21 $request = new http\Client\Request("GET", "http://localhost");
22 $request->setOptions(array("cookiestore" => $tmpfile));
24 server("cookie.inc", function($port) use($request, $tmpfile) {
25 $request->setOptions(array("port" => $port));
26 $client = new http\Client;
27 echo $client->requeue($request)->send()->getResponse();
29 echo $client->requeue($request)->send()->getResponse();
31 echo $client->requeue($request)->send()->getResponse();
34 server("cookie.inc", function($port) use($request, $tmpfile) {
35 $request->setOptions(array("port" => $port));
36 $client = new http\Client;
37 echo $client->requeue($request)->send()->getResponse();
39 echo $client->requeue($request)->send()->getResponse();
41 echo $client->requeue($request)->send()->getResponse();
45 server("cookie.inc", function($port) use($request, $tmpfile) {
46 $request->setOptions(array("port" => $port, "cookiesession" => true));
47 $client = new http\Client;
48 echo $client->requeue($request)->send()->getResponse();
50 echo $client->requeue($request)->send()->getResponse();
52 echo $client->requeue($request)->send()->getResponse();
56 server("cookie.inc", function($port) use($request, $tmpfile) {
57 $request->setOptions(array("port" => $port, "cookiesession" => false));
58 $client = new http\Client;
59 echo $client->requeue($request)->send()->getResponse();
61 echo $client->requeue($request)->send()->getResponse();
63 echo $client->requeue($request)->send()->getResponse();
74 Set-Cookie: counter=1;
76 X-Original-Transfer-Encoding: chunked
78 Set-Cookie: counter=2;
80 X-Original-Transfer-Encoding: chunked
82 Set-Cookie: counter=3;
84 X-Original-Transfer-Encoding: chunked
86 Set-Cookie: counter=4;
88 X-Original-Transfer-Encoding: chunked
90 Set-Cookie: counter=5;
92 X-Original-Transfer-Encoding: chunked
94 Set-Cookie: counter=6;
96 X-Original-Transfer-Encoding: chunked
98 Set-Cookie: counter=1;
100 X-Original-Transfer-Encoding: chunked
102 Set-Cookie: counter=1;
104 X-Original-Transfer-Encoding: chunked
106 Set-Cookie: counter=1;
108 X-Original-Transfer-Encoding: chunked
110 Set-Cookie: counter=2;
112 X-Original-Transfer-Encoding: chunked
114 Set-Cookie: counter=3;
116 X-Original-Transfer-Encoding: chunked
118 Set-Cookie: counter=4;
120 X-Original-Transfer-Encoding: chunked