Although cookies can be set like any other HTTP header, the portlet API provides the addProperty convenience method on the PortletResponse for setting cookies.
protected void doHeaders(RenderRequest request, RenderResponse response)
{
...
Cookie c = new Cookie("myCookieName", "myCookieValue");
c.setPath(request.getContextPath());
response.addProperty(c);
...
}