From eaa81d5fcdc35bae3c61a97d0caffabd73fcec53 Mon Sep 17 00:00:00 2001 From: Gleb Date: Sat, 15 Jun 2019 21:22:49 +0300 Subject: [PATCH] fix ios sso cookie bug when running on top-level domain (#2858) --- native_modules/RNCookieManagerIOS.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/native_modules/RNCookieManagerIOS.m b/native_modules/RNCookieManagerIOS.m index 92732f4fe..dfd067ef7 100644 --- a/native_modules/RNCookieManagerIOS.m +++ b/native_modules/RNCookieManagerIOS.m @@ -134,7 +134,8 @@ RCT_EXPORT_METHOD( [cookieStore getAllCookies:^(NSArray *allCookies) { NSMutableDictionary *cookies = [NSMutableDictionary dictionary]; for(NSHTTPCookie *currentCookie in allCookies) { - if([currentCookie.domain containsString:topLevelDomain]) { + NSString *domainWithDot = [NSString stringWithFormat:@".%@", currentCookie.domain]; + if([currentCookie.domain containsString:topLevelDomain] || [domainWithDot containsString:topLevelDomain]) { [cookies setObject:currentCookie.value forKey:currentCookie.name]; } }