public void parse(final Cookie cookie, final String secure) throws MalformedCookieException { cookie.setSecure(true); }
this.setDomain(domain); this.setExpiryDate(expires); this.setSecure(secure);
cookie.setSecure(true);
public void parse(final Cookie cookie, final String secure) throws MalformedCookieException { cookie.setSecure(true); }
public void parse(final Cookie cookie, final String secure) throws MalformedCookieException { cookie.setSecure(true); }
public void parse(final Cookie cookie, final String secure) throws MalformedCookieException { cookie.setSecure(true); }
public void parse(final Cookie cookie, final String secure) throws MalformedCookieException { cookie.setSecure(true); }
/** * Return a Cookie array * and auto importing domain and path when domain was empty. * * @param uri required Apache Common VFS supported file systems and response JSON format content. * @return Cookie[] */ Cookie[] getCookies(String uri){ if( null == cookies || 0 == cookies.size()) return null; for(Cookie cookie: cookies){ if("".equals(cookie.getDomain())){ String domain = uri.replaceAll("^.*:\\/\\/([^\\/]+)[\\/]?.*$", "$1"); cookie.setDomain(domain); cookie.setPath("/"); cookie.setExpiryDate(null); cookie.setSecure(false); } } return cookies.toArray(new Cookie[cookies.size()]); }
this.setDomain(domain); this.setExpiryDate(expires); this.setSecure(secure);
this.setDomain(domain); this.setExpiryDate(expires); this.setSecure(secure);
this.setDomain(domain); this.setExpiryDate(expires); this.setSecure(secure);
this.setDomain(domain); this.setExpiryDate(expires); this.setSecure(secure);
/** * This method parses the value of an HTTP {@linkplain HttpConstants#HEADER_COOKIE * "Cookie"} header that comes from a client to a server. It returns all the * Cookies present in the header. * * @param headerValue the value of the header from which the cookie will be * parsed. */ public static Cookie[] parseCookiesAsAServer(String headerValue, URI uri) { MimeHeaders mimeHeaders = new MimeHeaders(); mimeHeaders.addValue(HttpConstants.HEADER_COOKIE).setBytes(headerValue.getBytes(), 0, headerValue.length()); Cookies cs = new Cookies(mimeHeaders); Cookie[] cookies = new Cookie[cs.getCookieCount()]; for (int i = 0; i < cs.getCookieCount(); i++) { ServerCookie serverCookie = cs.getCookie(i); cookies[i] = transformServerCookieToClientCookie(serverCookie); if (uri != null) { cookies[i].setSecure(uri.getScheme() != null && uri.getScheme().equalsIgnoreCase("https")); cookies[i].setDomain(uri.getHost()); cookies[i].setPath(uri.getPath()); } } return cookies; }
cookie.setSecure(true);
cookie.setSecure(true);
public Cookie createCookie() throws ParseException { Cookie cookie = new Cookie(); cookie.setName(getName()); cookie.setValue(getValue()); cookie.setDomain(domain); cookie.setPath(path); if(expiryDate != null) { cookie.setExpiryDate(formatExpiryDate(expiryDate)); } if(maxAge != null && expiryDate == null) { cookie.setExpiryDate(new Date(System.currentTimeMillis() + Integer.valueOf(maxAge) * 1000L)); } if(secure != null) { cookie.setSecure(Boolean.valueOf(secure)); } if(version != null) { cookie.setVersion(Integer.valueOf(version)); } return cookie; }