/** * Encodes the {@link Cookie}s which were added by {@link #addCookie(Cookie)} * so far into an HTTP header value. If no {@link Cookie}s were added, * an empty string is returned. * * <strong>Be aware that calling this method will clear the content of the {@link CookieEncoder}</strong> */ public String encode() { String answer; if (server) { answer = encodeServerSide(); } else { answer = encodeClientSide(); } cookies.clear(); return answer; }