+ $path = $req[1];
+
+ if (isset($header['Cookie'])) {
+ $cookies = explode(";", $header['Cookie']);
+ for ($i = 0 ; $i < count($cookies) ; $i++) {
+ $nameval = explode("=", trim($cookies[$i]));
+ if (count($nameval) != 2) {
+ printf("WARNING: malformat cookie element [%s]\n", $cookies[$i]);
+ continue;
+ }
+ $cookie[$nameval[0]] = urldecode($nameval[1]);
+ }
+ }