cookies - php setcookie specific expire date not working
one text
I am trying to set a cookie with a specific expiry date using ....
$result=setcookie("testA", "A", strtotime("2038-01-01 23:59:59"));
but this is returning [$result=] true, but the expiry date is 2023-12-08.
To test this further I've run the following PHP, and find that the dates become static after test14.
$chk=2147483647;
$monthNb = 30 * 24 * 60 * 60;
for($n=0; $n<40; $n++) {
$nn=$n;
if ( $n<10 ) $nn="0$nn";
$v=$n*$monthNb;
if ( $v>$chk ) echo "<LI>ERR $v";
setcookie("test$nn", "$v", time() + $v);
}
How do I get the expiry date to simply run on a specific date?
Source