WKWebView Cookie Sync Issue in iOS 17

535 views Asked by At

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?

  1. It was reported by 3 people in our organisation.
  2. This issue has been reported by 8-10 end users.
  3. 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 in WKWebView post disabling Cookie auto sync via setHTTPShouldHandleCookies. 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.

0

There are 0 answers