Here I am creating a cookie.
setcookie('PHPSESSID', 'id'); But in the $ _COOKIE array, it becomes available only after a reboot. But how to get it right away?
After the client is transferred (via the
setcookie()function), the cookies will be accessed via the$_COOKIEarray the next time the page is loaded.$_REQUESTvalues are also in$_REQUEST.
If it is so important for you to immediately take data from the $_COOKIE , and not from a variable whose value you set via setcookie() , then write this:
setcookie('PHPSESSID', $id, ...); $_COOKIE['PHPSESSID'] = $id; Source: https://ru.stackoverflow.com/questions/683976/
All Articles
header('Location: ?');- Edward