"; e...">

Php $ _REQUEST does not contain cookies

I have a simple code:

<?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 am running it on IIS 7.5. I reloaded the page and I'm sure the browser sends the cookie to the php file (because I have it in $ _COOKIE). So why does it $_REQUESTcontain this cookie?

+5
source share
2 answers

$_REQUESTabout new settings PHP contains only $_GETand $_POST.

With typical PHP 5.3, php.ini is $_COOKIEeliminated from here request_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

+15
source

COOKIE , .. .

+10

All Articles