I think an article (or tutorial) on HTTP headers is more in demand. I'm working on such an article. Cookies are set via the HTTP header "Set-cookie". You can only have ONE set of HTTP headers per response (unless you're using server-push) and after a blank line, the headers are over.