コード例 #1
0
  @Override
  public synchronized void add(URI uri, HttpCookie cookie) {
    if (logVerbose) {
      Log.i(LOG_TAG, "add(URI " + uri + ", HttpCookie " + cookie + ")");
    }

    store.add(uri, cookie);

    persist();
  }
コード例 #2
0
 private void importCookies(Map<URI, List<SerializableCookie>> cookiesToRestore) {
   Map<URI, List<HttpCookie>> restoredCookies = new HashMap<URI, List<HttpCookie>>();
   if (null != cookiesToRestore) {
     for (URI uri : cookiesToRestore.keySet()) {
       restoredCookies.put(
           uri, SerializableHttpCookieAdapter.deserialize(cookiesToRestore.get(uri)));
     }
     for (URI uri : restoredCookies.keySet()) {
       for (HttpCookie cookie : restoredCookies.get(uri)) {
         store.add(uri, cookie);
       }
     }
   }
 }