// Get an instance of the selected cookie policy
final CookieSpecProvider provider = registry.lookup(policy);
if (provider == null) {
throw new HttpException("Unsupported cookie policy: " + policy);
}
final CookieSpec cookieSpec = provider.create(clientContext);
// Get all cookies available in the HTTP state
final List<Cookie> cookies = new ArrayList<Cookie>(cookieStore.getCookies());
// Find cookies matching the given origin
final List<Cookie> matchedCookies = new ArrayList<Cookie>();
final Date now = new Date();