I am facing a strange issue where in cookie sync fails(Few cookies drop) after upgrading to iOS 17 on some of the devices.
How Cookie Sync works in Our App?
- Authentication token is received via header in REST call.
- The tokens are synced with
NSHTTPCookieStorage
&WKHTTPCookieStore
- The WKWebView Request attaches the cookies found in WKHTTPCookieStore to the HTTP request.
What's the Issue?
WKWebView misses attaching few of the cookies randomly on iOS 17 on few of the devices.
How widespread is the issue?
- It was reported by 3 people in our organisation.
- This issue has been reported by 8-10 end users.
- This issue was reproducible on one of the iPhone 14 pro devices.
Did any fix work?
Resetting the iOS device settings to default worked for few of the end users, but failed to work on the device where the bug is still reproducible.
What We Tried?
- We tried setting the Cookies Manually to
NSMutableRequest
inWKWebView
post disabling Cookie auto sync viasetHTTPShouldHandleCookies
. It worked in all the cases except when the app is logged out and logged in again without going to foreground.
Please help with plausible solutions.