JamieFuller
Programmer
I have written a script.
here is the code:
I understand that cookies are not available until the next page load but why when I press refresh do I get a new value?
Kindest Regards
Jamie
here is the code:
Code:
if(isset($_COOKIE["cartId"]))
{
echo $_COOKIE["cartId"];
}else{
session_start();
setcookie("cartId", session_id(), time() + ((3600 * 24) * 30));
echo session_id();
}
I understand that cookies are not available until the next page load but why when I press refresh do I get a new value?
Kindest Regards
Jamie