(cookie.getExpiryDate() == null || cookie.getExpiryDate().after(new Date()))
(cookie.getExpiryDate() == null || cookie.getExpiryDate().after(new Date()))
(cookie.getExpiryDate() == null || cookie.getExpiryDate().after(new Date()))
(cookie.getExpiryDate() == null || cookie.getExpiryDate().after(new Date()))
(cookie.getExpiryDate() == null || cookie.getExpiryDate().after(new Date()))
/** * 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(); }
/** @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; }
for (int i = 0; i < cookies.length; i++) if (requestCookies != null && requestCookies.contains(cookies[i]) && cookies[i].getExpiryDate() == null) Date expiry = cookies[i].getExpiryDate(); if (expiry != null)
Date expiry = cookies[i].getExpiryDate(); if (expiry != null)
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() ); }
if (cookie.getExpiryDate() != null) { servletCookie.setMaxAge((int) ((cookie.getExpiryDate().getTime() - System.currentTimeMillis()) / 1000));