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 e1faa9ba9bd5ddaf031d13256154513a1db9c3cc..dca81bc38e2653cf5425597b3a64bf127ed5e045 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))