public boolean match(final Cookie cookie, final CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } return cookie.getSecure() == origin.isSecure(); }
&& (cookie.getSecure() ? secure : true);
public boolean match(final Cookie cookie, final CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } return cookie.getSecure() == origin.isSecure(); }
public boolean match(final Cookie cookie, final CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } return cookie.getSecure() == origin.isSecure(); }
public boolean match(final Cookie cookie, final CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } return cookie.getSecure() == origin.isSecure(); }
public boolean match(final Cookie cookie, final CookieOrigin origin) { if (cookie == null) { throw new IllegalArgumentException("Cookie may not be null"); } if (origin == null) { throw new IllegalArgumentException("Cookie origin may not be null"); } return cookie.getSecure() == origin.isSecure(); }
private static List<List<Pair<String, String>>> convertTokenValues(Map<String, Cookie> values) { List<List<Pair<String, String>>> tokens = new ArrayList<>(); for (Entry<String, Cookie> token : values.entrySet()) { Cookie cookie = token.getValue(); List<Pair<String, String>> fields = new ArrayList<>(); fields.add(new Pair<>("name", token.getKey())); fields.add(new Pair<>("value", cookie.getValue())); fields.add(new Pair<>("domain", cookie.getDomain())); fields.add(new Pair<>("path", cookie.getPath())); fields.add(new Pair<>("secure", Boolean.toString(cookie.getSecure()))); tokens.add(fields); } return tokens; } }
/** * This method formats the cookie so it can be send from server to client in a * {@linkplain HttpConstants#HEADER_COOKIE_SET "Set-Cookie"} header. */ public static String formatCookieForASetCookieHeader(Cookie cookie) { StringBuffer sb = new StringBuffer(); ServerCookie.appendCookieValue(sb, cookie.getVersion(), cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getDomain(), cookie.getComment(), -1, cookie.getSecure(), false); Date expiryDate = cookie.getExpiryDate(); if (expiryDate != null) { sb.append("; Expires="); sb.append(EXPIRE_FORMATTER.format(expiryDate)); } return sb.toString(); }
&& (cookie.getSecure() ? secure : true);
&& (cookie.getSecure() ? secure : true);
&& (cookie.getSecure() ? secure : true);
&& (cookie.getSecure() ? secure : true);
/** @deprecated (0.14.0) Use {@link #addCookie(ZestCookie)} instead. */ @Deprecated public void addCookie(Cookie cookie) { addCookie( cookie.getDomain(), cookie.getName(), cookie.getValue(), cookie.getPath(), cookie.getExpiryDate(), cookie.getSecure()); }
@Override public void addCookiesToClient(HttpClient client, Object cookiesObject, String policy, MuleEvent event, URI destinationUri) { Cookie[] cookies = (Cookie[]) cookiesObject; if (cookies != null && cookies.length > 0) { String host = destinationUri.getHost(); String path = destinationUri.getRawPath(); for (Cookie cookie : cookies) { client.getState().addCookie( new Cookie(host, cookie.getName(), cookie.getValue(), path, cookie.getExpiryDate(), cookie.getSecure())); } client.getParams().setCookiePolicy(CookieHelper.getCookiePolicy(policy)); } }
public Set<Cookie> getCookies() { Set<org.apache.commons.httpclient.Cookie> rawCookies = webClient.getCookieManager().getCookies(getHostName()); Set<Cookie> retCookies = new HashSet<Cookie>(); for(org.apache.commons.httpclient.Cookie c : rawCookies) { if (c.getPath() != null && getPath().startsWith(c.getPath())) { retCookies.add(new ReturnedCookie(c.getName(), c.getValue(), c.getDomain(), c.getPath(), c.getExpiryDate(), c.getSecure())); } } return retCookies; }
cookie.setMaxAge(maxAge); cookie.setSecure(cookies[i].getSecure()); cookie.setPath("/");
cookie.setMaxAge(maxAge); cookie.setSecure(cookies[i].getSecure()); cookie.setPath("/");
servletCookie.setSecure(cookie.getSecure());
private void logCookie(Cookie cookie) { Log_OC.d(TAG, "Cookie name: "+ cookie.getName() ); Log_OC.d(TAG, " value: "+ cookie.getValue() ); Log_OC.d(TAG, " domain: "+ cookie.getDomain()); Log_OC.d(TAG, " path: "+ cookie.getPath() ); Log_OC.d(TAG, " version: "+ cookie.getVersion() ); Log_OC.d(TAG, " expiryDate: " + (cookie.getExpiryDate() != null ? cookie.getExpiryDate().toString() : "--")); Log_OC.d(TAG, " comment: "+ cookie.getComment() ); Log_OC.d(TAG, " secure: "+ cookie.getSecure() ); }