diff --git a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java index 765cd9dedf..319cdd2a91 100755 --- a/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java +++ b/android/capacitor/src/main/java/com/getcapacitor/WebViewLocalServer.java @@ -297,7 +297,10 @@ private WebResourceResponse handleProxyRequest(WebResourceRequest request, PathH for (Map.Entry header : headers.entrySet()) { conn.setRequestProperty(header.getKey(), header.getValue()); } - conn.setRequestProperty("Cookie", CookieManager.getInstance().getCookie(url)); + String getCookie = CookieManager.getInstance().getCookie(url); + if (getCookie != null) { + conn.setRequestProperty("Cookie", getCookie); + } conn.setRequestMethod(method); conn.setReadTimeout(30 * 1000); conn.setConnectTimeout(30 * 1000);