{"action":"created","issue":{"url":"https://api.github.com/repos/prismicio/php-kit/issues/96","labels_url":"https://api.github.com/repos/prismicio/php-kit/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/prismicio/php-kit/issues/96/comments","events_url":"https://api.github.com/repos/prismicio/php-kit/issues/96/events","html_url":"https://github.com/prismicio/php-kit/pull/96","id":56689325,"number":96,"title":"PHP automatically decodes Cookies values, no need to use urlencoded char","user":{"login":"mteneur","id":210603,"avatar_url":"https://avatars.githubusercontent.com/u/210603?v=3","gravatar_id":"","url":"https://api.github.com/users/mteneur","html_url":"https://github.com/mteneur","followers_url":"https://api.github.com/users/mteneur/followers","following_url":"https://api.github.com/users/mteneur/following{/other_user}","gists_url":"https://api.github.com/users/mteneur/gists{/gist_id}","starred_url":"https://api.github.com/users/mteneur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mteneur/subscriptions","organizations_url":"https://api.github.com/users/mteneur/orgs","repos_url":"https://api.github.com/users/mteneur/repos","events_url":"https://api.github.com/users/mteneur/events{/privacy}","received_events_url":"https://api.github.com/users/mteneur/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-05T16:03:20Z","updated_at":"2015-07-20T20:27:28Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/prismicio/php-kit/pulls/96","html_url":"https://github.com/prismicio/php-kit/pull/96","diff_url":"https://github.com/prismicio/php-kit/pull/96.diff","patch_url":"https://github.com/prismicio/php-kit/pull/96.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/prismicio/php-kit/issues/comments/123022991","html_url":"https://github.com/prismicio/php-kit/pull/96#issuecomment-123022991","issue_url":"https://api.github.com/repos/prismicio/php-kit/issues/96","id":123022991,"user":{"login":"tremby","id":199635,"avatar_url":"https://avatars.githubusercontent.com/u/199635?v=3","gravatar_id":"","url":"https://api.github.com/users/tremby","html_url":"https://github.com/tremby","followers_url":"https://api.github.com/users/tremby/followers","following_url":"https://api.github.com/users/tremby/following{/other_user}","gists_url":"https://api.github.com/users/tremby/gists{/gist_id}","starred_url":"https://api.github.com/users/tremby/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tremby/subscriptions","organizations_url":"https://api.github.com/users/tremby/orgs","repos_url":"https://api.github.com/users/tremby/repos","events_url":"https://api.github.com/users/tremby/events{/privacy}","received_events_url":"https://api.github.com/users/tremby/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T20:27:28Z","updated_at":"2015-07-20T20:27:28Z","body":"@erwan and co: I'm surprised this one has sat untouched since February. Today is the first time I've tried to use experiments and I found this bug, and it's a blocker.\r\n\r\nThe relevant part of my code, with a workaround, is the following, and it's just the patched code from the kit written out longhand:\r\n\r\n```php\r\n\t\t// If a experiment token is in a cookie, use that\r\n\t\t// Most of the following is a temporary workaround before\r\n\t\t// https://github.com/prismicio/php-kit/pull/96 is fixed. Once that is\r\n\t\t// fixed the commented-out line can be used instead of everything which\r\n\t\t// precedes it.\r\n\t\t$ref = null;\r\n\t\tif ($cookie = self::getExperimentRefCookie()) {\r\n\t\t\t$parts = explode(' ', trim($cookie));\r\n\t\t\tif (count($parts) >= 2) {\r\n\t\t\t\t$experiments = self::getApi()->getExperiments();\r\n\t\t\t\t$running = $experiments->getRunning();\r\n\t\t\t\t$experiment = null;\r\n\t\t\t\tforeach ($running as $exp) {\r\n\t\t\t\t\tif ($exp->getGoogleId() == $parts[0]) {\r\n\t\t\t\t\t\t$experiment = $exp;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif ($experiment != null) {\r\n\t\t\t\t\t$variations = $experiment->getVariations();\r\n\t\t\t\t\t$varIndex = (int) $parts[1];\r\n\t\t\t\t\tif ($varIndex >= -1 && $varIndex < count($variations)) {\r\n\t\t\t\t\t\t$ref = $variations[$varIndex]->getRef();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($ref) {\r\n\t\t/* if ($ref = self::getApi()->getExperiments()->refFromCookie(self::getExperimentRefCookie())) { */\r\n\t\t\treturn $ref;\r\n\t\t}\r\n```"}}