diff --git a/core/java/android/webkit/CookieManager.java b/core/java/android/webkit/CookieManager.java index 379b425dc8b19..427ce76150e88 100644 --- a/core/java/android/webkit/CookieManager.java +++ b/core/java/android/webkit/CookieManager.java @@ -219,7 +219,11 @@ public final class CookieManager { // If cookie2 has a null value, it should come later in // the list. if (cookie2.value == null) { - return -1; + // If both cookies have null values, fall back to using the name + // difference. + if (cookie1.value != null) { + return -1; + } } else if (cookie1.value == null) { // Now we know that cookie2 does not have a null value, if // cookie1 has a null value, place it later in the list.