I've been using cookies for a long time, and nothing wrong has happened. But now, when I started to program on Windows the cookies don't work.
I've done the test:
file.php:
<?PHP
setcookie("tmp","something",time()+100);
hearder("Location: target.php");
?>
target.php:
<?PHP
echo $tmp;
?>
and:
Warning: Undefined variable: merda in C:\WINDOWS\Desktop\MOL\target.php on line 2
I already have tried use:
$time = mktime()+1200;
$date = date("l, d-M-y H:i:s", ($time));
header("Set-Cookie: $tmp=some; expires=$date GMT");
And the same happen.
Any can help me please?