--- Steve Buehler <[EMAIL PROTECTED]> wrote:
> Well, if I take off the "string domain" part, it will work just
> fine.

This is what I was trying to explain. The cookie wasn't being returned, because
the browser didn't think the hostname matched. By leaving it out, the browser
will use whatever it thinks the current hostname is, so it's sure to match.

You're also right about the order of setcookie() - the parameters are optional,
but since they are based on order, you can't selectively leave any out except
in between.

If you want to be able to specify whatever cookie restrictions you want, you
can always use header(). Both functions modify the HTTP headers; the only
difference with manually writing your own is that you could screw up the
formatting. My opinion on that is that you could screw up the formatting of the
values of setcookie() anyway, so it doesn't necessarily save you. :-) In short,
use header() if you require the flexibility, and use setcookie() if you want a
bit of help and abstraction.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to