- $nameval = explode("=", trim($cookies[$i]));
- if (count($nameval) != 2) {
- printf("WARNING: malformat cookie element [%s]\n", $cookies[$i]);
+ $name = mb_strstr($cookies[$i], "=", TRUE, 'UTF-8');
+ if ($name == FALSE) {
+ if (mb_strlen($cookies[$i]) > 0) {
+ $cookie[$cookies[$i]] = "";
+ }
+ else {
+ printf("WARNING: malformat cookie element [%s]\n", $cookies[$i]);
+ }