What does setcookie return?
| From: | Jeffery Cann | Date: | Wed, 06 Sep 2000 23:24:05 +0000 |
| Subject: | What does setcookie return? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15611@lists.php.net to get a copy of this message | ||
Greetings.
I assumed (it's not specified in the PHP manual) that if a cookie is
successfully set, then setcookie() returns 1 (int). This seems to hold
true. Then, I turned off cookies in my Netscape 4.72 (Linux) and tried
to call setcookie(). It appears that I set the cookie and setcookie()
returned 1.
What's the deal? I expect that if I cannot set a cookie, setcookie()
would return FALSE (i.e., int zero).
BTW - my test case (PHP 4.0.0 -- './configure' '--with-apache=../apache'
'--with-interbase=/opt/interbase' )
<?php
$i = setcookie("TestCookie", "TestValue");
echo "setcookie returned [$i]";
?>
Thanks
Jeff
--
Protect On-Line Free Speech!
http://www.eff.org/support/joineff.html