note 913 deleted from function.setcookie by sniper
| From: | sniper@php.net | Date: | Wed, 11 Dec 2002 06:43:59 +0000 |
| Subject: | note 913 deleted from function.setcookie by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40694@lists.php.net to get a copy of this message | ||
For a quick and dirty way to test Cookie support in a browser, here is
a script that will reload itself and check the status of the cookie. It works
for me. Your mileage may vary.
<?php
$status = 0;
if (isset($myTstCky) && ($myTstCky == "ChocChip")) $status = 1;
if (!isset($CCHK)) {
setcookie("myTstCky", "ChocChip");
header("Location: $PHP_SELF?CCHK=1");
exit;
}
?>
<html>
<head><title>Cookie Check</title></head>
<body bgcolor="#FFFFFF" text="#000000">
Cookie Check Status:
<?php
printf ('<font color="#%s">%s</font><br>;',
$status ? "00FF00" : "FF0000",
$status ? "PASSED!" : "FAILED!");
?>
</body>
</html>