cookies should be set before your server send any other info to the user's browser. So if you start sending ANY INFO, say any text, just a letter, even a space char. etc.) before setting your cookie you'll get this message.
This rules still applies when you have inclusions in your code. So you code might not be sending an info to the user but another script included in it may do so, which will cause the same error.
Another frequent mistake is to miss an invisible char somewhere before setcookie command which will again give you the headache (Even if its invisible its a char).
So the solution is to set the cookie before sending any other info to the user..
|