Hi All,
I've this problem with cookies. I am lost as I can't understand why this code does not work as expected.
Please help!!
$rq =$_REQUEST['r'] ;
$value = $_REQUEST['v'];
setcookie("XYZ",$value, time()+60*60*24*30) ;
echo "Value is ".$value;
if ($rq =='showdata'){
print_r($_COOKIE);
echo "Cookie is".$_COOKIE['XYZ'];
exit;
}
Output: when passing values r=showdata&v=test and pressing F5 repeatedly.
Value is testArray
(
[XYZ] =>
[PHPSESSID] => 060ee31ae35b8fb1262d0660bd925746
)
Cookie is