Repository: cordova-plugin-inappbrowser
Updated Branches:
  refs/heads/master bb69b79ca -> 234cca4e5


CB-10395 InAppBrowser's WebView not storing cookies reliable on Android

github close #147


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/commit/234cca4e
Tree: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/tree/234cca4e
Diff: 
http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/diff/234cca4e

Branch: refs/heads/master
Commit: 234cca4e5bda576ba0d2bdd92a4ab8fe68603215
Parents: bb69b79
Author: Wolfram Kriesing <[email protected]>
Authored: Wed Jan 20 21:55:03 2016 +0100
Committer: sgrebnov <[email protected]>
Committed: Mon Feb 8 12:15:24 2016 +0300

----------------------------------------------------------------------
 src/android/InAppBrowser.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser/blob/234cca4e/src/android/InAppBrowser.java
----------------------------------------------------------------------
diff --git a/src/android/InAppBrowser.java b/src/android/InAppBrowser.java
index e119a44..b9da5d7 100644
--- a/src/android/InAppBrowser.java
+++ b/src/android/InAppBrowser.java
@@ -41,6 +41,7 @@ import android.view.WindowManager.LayoutParams;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.webkit.CookieManager;
+import android.webkit.CookieSyncManager;
 import android.webkit.HttpAuthHandler;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
@@ -882,6 +883,13 @@ public class InAppBrowser extends CordovaPlugin {
         public void onPageFinished(WebView view, String url) {
             super.onPageFinished(view, url);
 
+            // CB-10395 InAppBrowser's WebView not storing cookies reliable to 
local device storage
+            if (android.os.Build.VERSION.SDK_INT >= 
android.os.Build.VERSION_CODES.LOLLIPOP) {
+                CookieManager.getInstance().flush();
+            } else {
+                CookieSyncManager.getInstance().sync();
+            }
+
             try {
                 JSONObject obj = new JSONObject();
                 obj.put("type", LOAD_STOP_EVENT);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to