title: Setting cookies in PHP with foreach and reading them in JavaScript
body: <p>I'm attempting to set a cookie in PHP and read the cookie on a different page with JavaScript.
  I'm not too sure about how to go about this because of the fact that I'm creating the cookies in a PHP foreach loop and I'd like to read all the cookies in JavaScript.</p>
  
  <p>My cookie creation foreach loop:</p>
  
  <pre><code>function parseSearchedTerm($searchedTerm, $bearer_token){
      $decode = json_decode($searchedTerm, true);
      foreach($decode['statuses'] as $q){
          $_COOKIE['text'] = $q['text'];
          if($q['geo']['coordinates'] != null){
          $_COOKIE['geo0'] = $q['geo']['coordinates'][0];
          $_COOKIE['geo1'] = $q['geo']['coordinates'][1];
          }   
      }
      invalidate_bearer_token($bearer_token);
  }
  </code></pre>