@Override public boolean isPersistent() { return delegate.isPersistent(); }
public boolean isPersistent() { return cookie.isPersistent(); }
@Override public boolean isPersistent() { return delegate.isPersistent(); }
/** * @param cookieName name of cookie. * @return whether cookie in the cookie store is persistent. */ public Boolean cookieIsPersistent(String cookieName) { Boolean result = null; Cookie cookie = getCookie(cookieName); if (cookie != null) { result = cookie.isPersistent(); } return result; }
@Override public void addCookie(Cookie cookie) { if (omitNonPersistentCookies && !cookie.isPersistent()) return; String name = cookie.getName() + cookie.getDomain(); // Save cookie into local store, or remove if expired if (!cookie.isExpired(new Date())) { cookies.put(name, cookie); } else { cookies.remove(name); } // Save cookie into persistent store SharedPreferences.Editor prefsWriter = cookiePrefs.edit(); prefsWriter.putString(COOKIE_NAME_STORE, TextUtils.join(",", cookies.keySet())); prefsWriter.putString(COOKIE_NAME_PREFIX + name, encodeCookie(new SerializableCookie(cookie))); prefsWriter.commit(); }
cookie.put(EXPIRES, c.getExpiryDate().getTime() + ""); cookie.put(PERSISTENT, c.isPersistent() + ""); cookie.put(SECURE, c.isSecure() + ""); response.addCookie(cookie);
@Override protected void saveCookies(List<Cookie> cookies) { for (Cookie c : cookies) { if (!c.isPersistent()) { continue; } SQLiteUtil.bindString(myInsertStatement, 1, c.getDomain()); SQLiteUtil.bindString(myInsertStatement, 2, c.getPath()); SQLiteUtil.bindString(myInsertStatement, 3, c.getName()); SQLiteUtil.bindString(myInsertStatement, 4, c.getValue()); SQLiteUtil.bindDate(myInsertStatement, 5, c.getExpiryDate()); myInsertStatement.bindLong(6, c.isSecure() ? 1 : 0); final long id = myInsertStatement.executeInsert(); myDeletePortsStatement.bindLong(1, id); myDeletePortsStatement.execute(); if (c.getPorts() != null) { myInsertPortsStatement.bindLong(1, id); for (int port : c.getPorts()) { myInsertPortsStatement.bindLong(2, port); myInsertPortsStatement.execute(); } } } }