Within a Drupal theme, page.tpl.php, I’m setting a COOKIE/GLOBAL variable.
However, when I try accessing the Cookie or Global within the node page content, it is always blank. If I reload the page I can finally access the cookie. Is there no way to pass the set variable to the node?
cookie that set with
setcookie()is visible in$_COOKIEsuperglobal only on next request.this happens because cookies are stored on a client and are passed with request. obviously on the first request there is no such cookie, and
setcookie()doesn’t modify that superglobal.