From b48a497c63ba93583e271ae36d5273e0825f6794 Mon Sep 17 00:00:00 2001 From: yzh Date: Tue, 6 Aug 2024 11:32:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E7=BA=A7=E5=9F=9F=E5=90=8D=E7=9A=84cookie=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E5=88=B0=E4=BA=8C=E7=BA=A7=E5=9F=9F=E5=90=8D=E4=B8=8A?= =?UTF-8?q?=E8=AF=BB=E5=8F=96=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ohos/src/main/ets/components/plugin/MyCookieManager.ets | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/MyCookieManager.ets b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/MyCookieManager.ets index e1faa9ba..dca81bc3 100644 --- a/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/MyCookieManager.ets +++ b/flutter_inappwebview_ohos/ohos/src/main/ets/components/plugin/MyCookieManager.ets @@ -104,7 +104,11 @@ export default class MyCookieManager extends ChannelDelegateImpl { } try { - web_webview.WebCookieManager.configCookie(url, name + "=" + value) + let cookieStr = name + "=" + value + if (domain != null) { + cookieStr = cookieStr + ";domain = " + domain + } + web_webview.WebCookieManager.configCookie(url, cookieStr) web_webview.WebCookieManager.configCookie(url, "Path=" + path) if (domain != null) web_webview.WebCookieManager.configCookie(url, "Domain=" + domain) if (expiresDate != null) web_webview.WebCookieManager.configCookie(url, "Expires=" + this.getCookieExpirationDate(expiresDate)) -- Gitee