Cookie cookie = response.getCookieIgnoreCase("jsessionid");
// TODO: Add a constructor to the Cookie class that takes a Cookie
// as parameter.
HttpSessionCookie sessionCookie = null;
if (cookie != null)
{
sessionCookie = new HttpSessionCookie(cookie.getDomain(),
cookie.getName(), cookie.getValue());
sessionCookie.setComment(cookie.getComment());
sessionCookie.setExpiryDate(cookie.getExpiryDate());
sessionCookie.setPath(cookie.getPath());
sessionCookie.setSecure(cookie.isSecure());
}
return sessionCookie;
}