This commit is contained in:
kunfei
2023-03-09 10:08:18 +08:00
parent a6c9b05d52
commit b33a7e3d01

View File

@@ -11,8 +11,8 @@ fun CookieManager.removeCookie(domain: String) {
"https://$domain"
)
urls.forEach { url ->
val cookieGlob = cm.getCookie(url)
cookieGlob.splitNotBlank(";").forEach {
val cookieGlob: String? = cm.getCookie(url)
cookieGlob?.splitNotBlank(";")?.forEach {
val cookieName = it.substringBefore("=")
cm.setCookie(url, "$cookieName=; Expires=Wed, 31 Dec 2000 23:59:59 GMT")
}