Re: What does setcookie return?
| From: | Martin | Date: | Thu, 07 Sep 2000 08:28:23 +0000 |
| Subject: | Re: What does setcookie return? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-15673@lists.php.net to get a copy of this message | ||
Hi Jeffery,
true means, that the http-header with the cookie was sent successfully. What
the browser does with it - nobody knows. You could only check, if the user
has turned cookie on, if you try to read the cookie on the next page.
Martin
Jeffery Cann wrote:
> 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
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net