I'm not an HTTP expert, but I think that the Set-Cookie header should be sent before the content-type.
In reply to Re: cookie problem by Chady in thread cookie problem by perlknight