From 398de3c399e69415c31917a8e190fcca1ceaa103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E9=93=AD=E6=9D=B0?= Date: Thu, 23 Nov 2023 09:31:43 +0800 Subject: [PATCH] feat:Fix iOS empty cookie bug --- .../com/multiplatform/webview/cookie/IOSCookieManager.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/webview/src/iosMain/kotlin/com/multiplatform/webview/cookie/IOSCookieManager.kt b/webview/src/iosMain/kotlin/com/multiplatform/webview/cookie/IOSCookieManager.kt index 3b8539fb..2cbfa204 100644 --- a/webview/src/iosMain/kotlin/com/multiplatform/webview/cookie/IOSCookieManager.kt +++ b/webview/src/iosMain/kotlin/com/multiplatform/webview/cookie/IOSCookieManager.kt @@ -36,7 +36,10 @@ object IOSCookieManager : CookieManager { cookieStore.getAllCookies { cookies -> cookies?.forEach { cookie -> if (cookie is NSHTTPCookie) { - if (url.contains(cookie.domain)) { + KLogger.d { + "IOSCookieManager getCookies: name: ${cookie.name}, value: ${cookie.value} url: $url, domain: ${cookie.domain}" + } + if (url.contains(cookie.domain.removePrefix("."))) { cookieList.add( Cookie( name = cookie.name,