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.
My cookie creation foreach loop:
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);
}