Hi.
There are two possible solutions.
First up, you have some HTML code (probably an empty line ?!?) before your PHP tags in your file. Normally, with basic setup, this makes impossible to send any kind of HTTP header informations to the client. Cookies are also 'transmitted' via the HTTP header.
On the other hand there's a possible solution for your question, and the opening texts, too. There is a setting in PHP.INI, called OUTPUT_BUFFERING. This is, in its basic state, turned OFF. Turning this swith ON means you are able to send header info (e.g. cookies, vars, etc.) after you have written some output to the channel. Note that this means some (minor) loss of performance also.
Best
OverLord @ FruttaElettronica.CoM