遍历查找Cookie的常用方法 Cookie iWantCookie = null; for (Cookie cookie : cookies) { if ("key2".equals(cookie.getName())) { iWantCookie = cookie; break; } } if (iWantCookie != null) { //找到了所需要的cookie }