// request.setHeader("Keep-Alive","300");
CookieEncoder httpCookieEncoder = new CookieEncoder(false);
httpCookieEncoder.addCookie("my-cookie", "foo");
httpCookieEncoder.addCookie("another-cookie", "bar");
request.setHeader(HttpHeaders.Names.COOKIE, httpCookieEncoder.encode());
List<Entry<String, String>> headers = request.getHeaders();
// send request
channel.write(request);