although you should post some code with your problem to get the best results it seems that this is one of those cases where you have outputted something to the browser before trying to send a cookie
you must do this before everything, even a simple break line which is at the top of your page by mistake.
it must be before the html
if you understand this but cant figure out how to change your script so it works or still get errors, post your code and i and the rest of the forum will try to help