本文整理了Java中okhttp3.Cookie.domain()
方法的一些代码示例,展示了Cookie.domain()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cookie.domain()
方法的具体详情如下:
包路径:okhttp3.Cookie
类名称:Cookie
方法名:domain
[英]Returns the cookie's domain. If #hostOnly() returns true this is the only domain that matches this cookie; otherwise it matches this domain and all subdomains.
[中]返回cookie的域。如果#hostOnly()返回true,则这是唯一与此cookie匹配的域;否则,它将匹配此域和所有子域。
代码示例来源:origin: jeasonlzy/okhttp-OkGo
public SerializableCookie(String host, Cookie cookie) {
this.cookie = cookie;
this.host = host;
this.name = cookie.name();
this.domain = cookie.domain();
}
代码示例来源:origin: jeasonlzy/okhttp-OkGo
private String getCookieToken(Cookie cookie) {
return cookie.name() + "@" + cookie.domain();
}
代码示例来源:origin: jeasonlzy/okhttp-OkGo
private String getCookieToken(Cookie cookie) {
return cookie.name() + "@" + cookie.domain();
}
代码示例来源:origin: jeasonlzy/okhttp-OkGo
private void writeObject(ObjectOutputStream out) throws IOException {
out.defaultWriteObject();
out.writeObject(cookie.name());
out.writeObject(cookie.value());
out.writeLong(cookie.expiresAt());
out.writeObject(cookie.domain());
out.writeObject(cookie.path());
out.writeBoolean(cookie.secure());
out.writeBoolean(cookie.httpOnly());
out.writeBoolean(cookie.hostOnly());
out.writeBoolean(cookie.persistent());
}
代码示例来源:origin: seven332/EhViewer
public Key(Cookie cookie) {
this.name = cookie.name();
this.domain = cookie.domain();
this.path = cookie.path();
}
代码示例来源:origin: GitLqr/LQRWeChat
@Override
public int hashCode() {
int hash = 17;
hash = 31 * hash + cookie.name().hashCode();
hash = 31 * hash + cookie.domain().hashCode();
hash = 31 * hash + cookie.path().hashCode();
hash = 31 * hash + (cookie.secure() ? 0 : 1);
hash = 31 * hash + (cookie.hostOnly() ? 0 : 1);
return hash;
}
}
代码示例来源:origin: seven332/EhViewer
public ContentValues toContentValues(Cookie cookie) {
ContentValues contentValues = new ContentValues(9);
contentValues.put(COLUMN_NAME, cookie.name());
contentValues.put(COLUMN_VALUE, cookie.value());
contentValues.put(COLUMN_EXPIRES_AT, cookie.expiresAt());
contentValues.put(COLUMN_DOMAIN, cookie.domain());
contentValues.put(COLUMN_PATH, cookie.path());
contentValues.put(COLUMN_SECURE, cookie.secure());
contentValues.put(COLUMN_HTTP_ONLY, cookie.httpOnly());
contentValues.put(COLUMN_PERSISTENT, cookie.persistent());
contentValues.put(COLUMN_HOST_ONLY, cookie.hostOnly());
return contentValues;
}
代码示例来源:origin: GitLqr/LQRWeChat
private void writeObject(ObjectOutputStream out) throws IOException {
out.writeObject(cookie.name());
out.writeObject(cookie.value());
out.writeLong(cookie.persistent() ? cookie.expiresAt() : NON_VALID_EXPIRES_AT);
out.writeObject(cookie.domain());
out.writeObject(cookie.path());
out.writeBoolean(cookie.secure());
out.writeBoolean(cookie.httpOnly());
out.writeBoolean(cookie.hostOnly());
}
代码示例来源:origin: jeasonlzy/okhttp-OkGo
/** 根据url移除当前的cookie */
@Override
public synchronized boolean removeCookie(HttpUrl url, Cookie cookie) {
if (!cookies.containsKey(url.host())) return false;
String cookieToken = getCookieToken(cookie);
if (!cookies.get(url.host()).containsKey(cookieToken)) return false;
//内存移除
cookies.get(url.host()).remove(cookieToken);
//数据库移除
String whereClause = "host=? and name=? and domain=?";
String[] whereArgs = {url.host(), cookie.name(), cookie.domain()};
CookieManager.getInstance().delete(whereClause, whereArgs);
return true;
}
代码示例来源:origin: GitLqr/LQRWeChat
@Override
public boolean equals(Object other) {
if (!(other instanceof IdentifiableCookie)) return false;
IdentifiableCookie that = (IdentifiableCookie) other;
return that.cookie.name().equals(this.cookie.name())
&& that.cookie.domain().equals(this.cookie.domain())
&& that.cookie.path().equals(this.cookie.path())
&& that.cookie.secure() == this.cookie.secure()
&& that.cookie.hostOnly() == this.cookie.hostOnly();
}
代码示例来源:origin: seven332/EhViewer
CookieSet set = map.get(cookie.domain());
if (set == null) {
set = new CookieSet();
map.put(cookie.domain(), set);
代码示例来源:origin: GitLqr/LQRWeChat
private static String createCookieKey(Cookie cookie) {
return (cookie.secure() ? "https" : "http") + "://" + cookie.domain() + cookie.path() + "|" + cookie.name();
}
代码示例来源:origin: seven332/EhViewer
Cookie toRemove = null;
CookieSet set = map.get(cookie.domain());
if (set == null) {
set = new CookieSet();
map.put(cookie.domain(), set);
代码示例来源:origin: seven332/EhViewer
private Cookie longLive(Cookie cookie) {
return new Cookie.Builder()
.name(cookie.name())
.value(cookie.value())
.domain(cookie.domain())
.path(cookie.path())
.expiresAt(Long.MAX_VALUE)
.build();
}
代码示例来源:origin: limedroid/XDroidMvp
protected String getCookieToken(Cookie cookie) {
return cookie.name() + cookie.domain();
}
代码示例来源:origin: limedroid/XDroidMvp
private void writeObject(ObjectOutputStream out) throws IOException {
out.writeObject(cookie.name());
out.writeObject(cookie.value());
out.writeLong(cookie.expiresAt());
out.writeObject(cookie.domain());
out.writeObject(cookie.path());
out.writeBoolean(cookie.secure());
out.writeBoolean(cookie.httpOnly());
out.writeBoolean(cookie.hostOnly());
out.writeBoolean(cookie.persistent());
}
代码示例来源:origin: franmontiel/PersistentCookieJar
@Override
public int hashCode() {
int hash = 17;
hash = 31 * hash + cookie.name().hashCode();
hash = 31 * hash + cookie.domain().hashCode();
hash = 31 * hash + cookie.path().hashCode();
hash = 31 * hash + (cookie.secure() ? 0 : 1);
hash = 31 * hash + (cookie.hostOnly() ? 0 : 1);
return hash;
}
}
代码示例来源:origin: franmontiel/PersistentCookieJar
private void writeObject(ObjectOutputStream out) throws IOException {
out.writeObject(cookie.name());
out.writeObject(cookie.value());
out.writeLong(cookie.persistent() ? cookie.expiresAt() : NON_VALID_EXPIRES_AT);
out.writeObject(cookie.domain());
out.writeObject(cookie.path());
out.writeBoolean(cookie.secure());
out.writeBoolean(cookie.httpOnly());
out.writeBoolean(cookie.hostOnly());
}
代码示例来源:origin: franmontiel/PersistentCookieJar
@Override
public boolean equals(Object other) {
if (!(other instanceof IdentifiableCookie)) return false;
IdentifiableCookie that = (IdentifiableCookie) other;
return that.cookie.name().equals(this.cookie.name())
&& that.cookie.domain().equals(this.cookie.domain())
&& that.cookie.path().equals(this.cookie.path())
&& that.cookie.secure() == this.cookie.secure()
&& that.cookie.hostOnly() == this.cookie.hostOnly();
}
代码示例来源:origin: franmontiel/PersistentCookieJar
private static String createCookieKey(Cookie cookie) {
return (cookie.secure() ? "https" : "http") + "://" + cookie.domain() + cookie.path() + "|" + cookie.name();
}
内容来源于网络,如有侵权,请联系作者删除!