I am having problems with the setcookie function initializing and timing out cookies using internet explorer 6. The following code is in my index file:
<?php
header(“P3P: CP=TELa OUR SAM PUR FIN DSP ALL COR");
header(Set-Cookie: f=abc; Max-Age=10; path=/);
header("Set-Cookie: e=dfg; Max-Age=90; path=/; Version=1");
setcookie('a', '1', time() + 8);
setcookie('b', '2', time() + 8, '/');
setcookie('c', '3', time() + 8, '/');
setcookie('timeout', 'time()+3600');
setcookie("time", "time");
php?>
I then use this form from the index page to go to the next page so that I can see the values in the cookies:
<form name="form1" method="post" action="showset.php">
<input type="submit" name="Submit" value="Show Cookie Value">
</form>
On the next page, I just echo the cookie values:
echo "cookie set using 'setcookie': " . $_COOKIE['a'] . '<br />';
However, only 3 of the cookies are set up (a, b, abc). Also, none of them expire. Can anyone please lend me some suggestions??
Thanks
<?php
header(“P3P: CP=TELa OUR SAM PUR FIN DSP ALL COR");
header(Set-Cookie: f=abc; Max-Age=10; path=/);
header("Set-Cookie: e=dfg; Max-Age=90; path=/; Version=1");
setcookie('a', '1', time() + 8);
setcookie('b', '2', time() + 8, '/');
setcookie('c', '3', time() + 8, '/');
setcookie('timeout', 'time()+3600');
setcookie("time", "time");
php?>
I then use this form from the index page to go to the next page so that I can see the values in the cookies:
<form name="form1" method="post" action="showset.php">
<input type="submit" name="Submit" value="Show Cookie Value">
</form>
On the next page, I just echo the cookie values:
echo "cookie set using 'setcookie': " . $_COOKIE['a'] . '<br />';
However, only 3 of the cookies are set up (a, b, abc). Also, none of them expire. Can anyone please lend me some suggestions??
Thanks