/** * Parses the metadata cookie that our Javascript API set * * @return array */ protected function getMetadataCookie() { $cookieName = $this->config->getMetadataCookieName(); // The cookie value can be wrapped in "-characters so remove them if (!($cookieValue = trim($this->httpRequest->getCookie($cookieName), '"'))) { return array(); } parse_str($cookieValue, $metadata); array_walk($metadata, function (&$value, &$key) { $value = urldecode($value); $key = urldecode($key); }); return $metadata; }