From 86a90aff5c52f3b84396c37e506e56eeebc4189c Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Tue, 25 Aug 2020 12:15:12 -0400 Subject: [PATCH] fix android 6 cookie problem --- app/src/main/java/awais/instagrabber/utils/Utils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/utils/Utils.java b/app/src/main/java/awais/instagrabber/utils/Utils.java index 819c8a1d..b7f9a525 100755 --- a/app/src/main/java/awais/instagrabber/utils/Utils.java +++ b/app/src/main/java/awais/instagrabber/utils/Utils.java @@ -142,10 +142,10 @@ public final class Utils { final URI uri1 = new URI("https://instagram.com"); final URI uri2 = new URI("https://instagram.com/"); final URI uri3 = new URI("https://i.instagram.com/"); - for (final String cookie : cookieRaw.split(";")) { + for (final String cookie : cookieRaw.split("; ")) { final String[] strings = cookie.split("=", 2); final HttpCookie httpCookie = new HttpCookie(strings[0].trim(), strings[1].trim()); - httpCookie.setDomain("instagram.com"); + httpCookie.setDomain(".instagram.com"); httpCookie.setPath("/"); httpCookie.setVersion(0); cookieStore.add(uri1, httpCookie);