If you're creating cookies to be sent back to the user's browser, you use the Response.Cookies collection. However, you need to do this before you send any HTML to the page. The reason for this is that the cookie commands go into the page header, which has to be created before any HTML is sent.
The exception to this rule is if your web page is being buffered, either on a per-page basis (using Response.Buffer = True) or on a site-wide basis by configuring the option in the IIS manager. If the page is buffered, the page is completely built before anything is sent to the user's browser.