title: PHP cookie array works with integers but not strings
body: <p>This code correctly creates a cookie, and then returns an array.</p>
  
  <pre><code>$exampleString1 = 123;
  $exampleString2 = 456;
  
  $exampleStringArray =  array();
  $exampleStringArray[] = $exampleString1;
  $exampleStringArray[] = $exampleString2;
  
  $exampleStringArrayEncoded = json_encode($exampleStringArray);
  setcookie('exampleCookie', $exampleStringArrayEncoded, time() + (86400 * 30), "/");
  
  
  if(isset($_COOKIE['exampleCookie'])) {
      $exampleCookie = $_COOKIE['exampleCookie'];
      $exampleCookieDecoded = json_decode($exampleCookie);
      var_dump($exampleCookieDecoded);
  }
  </code></pre>
  
  <p>However this does not work when the array contains strings by changing the first lines to:</p>
  
  <pre><code>$exampleString1 = 'abc';
  $exampleString2 = 'def';
  </code></pre>
  
  <p>The dumped value is simply NULL</p>
  
  <p>Can anyone explain why I am unable to store strings in a cookie?</p>