I am setting a cookie and that is working fine but for some reason I'm not able to retrieve the value of the cookie. I can see the cookie is set in the browser developer tools but when I try to print_r
it comes up empty.
Here is where I see the values of the cookie in developer tools.
Here is where I'm trying to get the value that is currently not working:
$additionalData = json_decode($_COOKIE['antennasNow'], true);
echo '<pre>';
print_r($additionalData);
echo '</pre>';
Here is where I set the cookie in case it is helpful:
setcookie('antennasNow', json_encode($cookieValue), time()+3600);
And this is how I'm setting the value of the cookie in case it helps:
$cookieValue = array(
'base_Sku' => $base_Sku,
'vhf_UHF_Type' => $vhf_UHF_Type,
'ptc_Type' => $ptc_Type,
'type_700_800_900' => $type_700_800_900,
'band' => $band,
'polarization' => $polarization,
'gain_Sku' => $gain_Sku,
'exposed_Dipole_Az_Pattern' => $exposed_Dipole_Az_Pattern,
'collinear_Az_Pattern' => $collinear_Az_Pattern,
'panel_Az_Pattern' => $panel_Az_Pattern,
'dual_Input' => $dual_Input,
'narrowband_Connector' => $narrowband_Connector,
'beamtilt' => $beamtilt,
'null_Fill' => $null_Fill,
'heavy_Duty' => $heavy_Duty,
'invert_Mount' => $invert_Mount,
);
I followed these tips/steps from other threads: