I know this might be an extremely beginner level question but I am just a month into PHP so please bear with me. I am trying to set a cookie in a WordPress blog. The cookie rece
When you set a cookie, it doesn't populate $_COOKIE
on that page load, as that variable is loaded from what the browser sends you. A workaround for that would be to set $_COOKIE['name'] = $name;
after your setcookie
statement - but that does not guarantee that the browser accepted and actually set the cookie - just a way to make it available immediately in your script.