Hi,
I'm trying to write a short/simple function that will get the information that is in a COOKIE and return it.
I have a COOKIE that is called auth. This COOKIE is properly set as I can do an echo $_COOKIE; and it will show the proper number. The problem arises when I try to put it into a function. This is the code that I have to try and access a function and return the auth info:
<?php
function getAuth()
{
return $_COOKIE['auth'];
}
?>
I get absolutely nothing returned to me. I have also tried putting it into a local variable first:
<?php
function getAuth()
{
$auth = $_COOKIE['auth'];
return $auth;
}
?>
but still nothing is returned. The file that I have this function in is included in the page that I'm trying to call it from, so the function is global and shouldn't have any problem accessing/returning the cookie information.
Any help is very appreciated, thank you.