code = httpClient.executeMethod(login);
HttpState state = httpClient.getState();
//copy all the cookies into the Parser cookie manager
ConnectionManager cm = Parser.getConnectionManager();
for (org.apache.commons.httpclient.Cookie cookie : state.getCookies()) {
if (cookie.getName().equals("NetflixShopperId")) {
shopperId = cookie.getValue();
}
Cookie pCookie = new Cookie(cookie.getName(), cookie.getValue());
pCookie.setDomain(cookie.getDomain());
pCookie.setPath(cookie.getPath());
cm.setCookie(pCookie, null);
}
String result = login.getResponseBodyAsString();
login.releaseConnection();