I have some simple code like this:
<?php
setcookie("user","test", time() + 3600);
echo $_REQUEST['user']."<br>";
echo $_COOKIE['user'];
?>
and this is the result:
Notice: Undefined index: user in D:\interpub\wwwroot\live\cookie.php on line 3
test
I’m running it on IIS 7.5. I’ve reloaded the page and I’m sure the browser sends the cookie to the php file (because I have it in $_COOKIE). So why doesn’t $_REQUEST contain that cookie?
$_REQUESTon newer PHP setups contains only$_GETand$_POST.With the typical PHP 5.3 php.ini
$_COOKIEis excluded from there byrequest_order=GP.See http://php.net/manual/en/ini.core.php#ini.request-order
And http://php.net/manual/en/ini.core.php#ini.variables-order