} return bestCookie; } private void writeObject(ObjectOutputStream out) throws IOException { out.writeObject(cookie.getName()); out.writeObject(cookie.getValue()); out.writeObject(cookie.getComment()); out.writeObject(cookie.getDomain()); out.writeObject(cookie.getExpiryDate()); out.writeObject(cookie.getPath()); out.writeInt(cookie.getVersion()); out.writeBoolean(cookie.isSecure()); } private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { String name = (String)in.readObject(); String value = (String)in.readObject(); clientCookie = new BasicClientCookie(name, value); clientCookie.setComment((String)in.readObject());