# PersistentCookieJar

class PersistentCookieJar(context: Context, dbName: String) : CookieJar
Content copied to clipboard

持久化存储Cookie

## Parameters

dbName

数据库名称, 设置多个名称可以让不同的客户端共享不同的cookies

## Constructors

PersistentCookieJar
Link copied to clipboard
fun PersistentCookieJar(context: Context, dbName: String = "net_cookies")
Content copied to clipboard
数据库名称, 设置多个名称可以让不同的客户端共享不同的cookies

## Functions

addAll
Link copied to clipboard
fun addAll(url: HttpUrl, cookies: List<Cookie>)
Content copied to clipboard
添加Cookie到指定域名下
clear
Link copied to clipboard
fun clear()
Content copied to clipboard
清除应用所有Cookie
getAll
Link copied to clipboard
fun getAll(url: HttpUrl): List<Cookie>
Content copied to clipboard
获取指定域名下的所有Cookie
loadForRequest
Link copied to clipboard
open override fun loadForRequest(url: HttpUrl): List<Cookie>
Content copied to clipboard
remove
Link copied to clipboard
fun remove(url: HttpUrl)
Content copied to clipboard
删除指定域名的所有Cookie
fun remove(url: HttpUrl, cookieName: String)
Content copied to clipboard
删除指定域名下的指定cookie
saveFromResponse
Link copied to clipboard
open override fun saveFromResponse(url: HttpUrl, cookies: List<Cookie>)
Content copied to clipboard

## Properties

context
Link copied to clipboard
val context: Context
Content copied to clipboard
dbName
Link copied to clipboard
val dbName: String
Content copied to clipboard
数据库名称, 设置多个名称可以让不同的客户端共享不同的cookies