Originally posted by simon622
$HTTP_COOKIE_VARS[]; is the depricated version of $_COOKIE[].
They are fundamentally the same, just one is old.
Actually they are fundementally different.
$COOKIES and other ($POST, $GET, $SESSION,etc) are SUPER GLOBALS unlike any other token in php. This means that this reference accesses the same data regardless of context.
$HTTP_COOKIE_VARS[] and others ($HTTP_POST_VARS, $HTTP_GET_VARS, etc) are normal array type variables that store the particular data.
What does this mean? To illustrate make a page with the following code and call it passing a variable on the query string like this
testpage.php?getvar=myvalue
////////////////////////////////////////////////////////////////
<?
function test1()
{
echo "<br>I can not see this var - " . $HTTP_GET_VARS['getvar'];
echo "<br>I can see the super global var - " . $_GET['getvar'];
//now need to reference to a global context
global $HTTP_GET_VARS;
echo "<br>AHhhh, now I can see the var - " . $HTTP_GET_VARS['getvar'];
}
test1();
?>
///////////////////////////////////////////////////////////////
You see that accessing HTTP_GET_VARS is different than the super global $_GET. Of course in root context you do not have to globolize but this just shows you that there is a fundemental difference between the super globals.