[thelist] PHP SetCookie() function

Jay Greenspan jay at trans-city.com
Wed Mar 7 10:59:08 CST 2001

> Things that have screwed me up when working with PHP and cookies:
> 1. You can't have any whitespace between the top of your document and your
> header, and that means inside any includes as well.
> 2. Cookies must be sent before any other headers (and therefore before your
> <html> as well).

quite true ... watch for extra hard returns at the end of include files. The
?> needs to be the last thing.

> 3. If the user has cookies turned off you're a bit stuck.
> The manual at http://www.php.net/manual/en/function.setcookie.php has some
> excellent user comments which list ways round these as well as solutions to
> problems other people have experienced.
> What the hell is a "wonk", anyway? :-)


thought I was making it up, eh?


More information about the thelist mailing list