Re: Cookies on WinXP

From: Date: Fri, 01 Aug 2003 00:09:03 +0000
Subject: Re: Cookies on WinXP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-157845@lists.php.net to get a copy of this message
--- Steve Buehler <steve@ibapp.com> 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/

« previous php.general (#157845) next »