There is no such "restriction of cookies."

I think what the manual meant to say was that cookies must be sent prior to any output, which is the same restriction any other header has that you wish to set with the header() function, for example.

I have forwarded this along to the documentation team. Thanks for pointing it out.


Kevin Stone wrote:
And I quote, "setcookie() defines a cookie to be sent along with the rest of
the header information. Cookies must be sent before any other headers are
sent (this is a restriction of cookies, not PHP).";

If you absolutely must set cookies after you set other headers then use
Output Buffering.


PHP General Mailing List (
To unsubscribe, visit:

Reply via email to