cookies refresh problem
-
I have added an action
add_action(“init”, “CookiesUpdateit”);I update the cookie here
function CookiesUpdateit()
{
setcookie(“CookiesOK”,”Y”,$t ,COOKIEPATH, COOKIE_DOMAIN, false);
}
This works as chrome inspector sees my cookie.In the screen , i read the cookie
$_COOKIE[‘CookiesOK’]but strangely it only works when I have set the cookie twice, so it seems not to be refreshing the global $_COOKIE instantly
My dirty workaround is a to set global in the top and in the screen I test
($_COOKIE[‘CookiesOK’] == “Y”) || ($wegotcookies==”Y”)but can I make the $_COOKIE refresh instantly, so when i first read it I get the latest value ?
- The topic ‘cookies refresh problem’ is closed to new replies.