Unable to set cookie in WKWebView using "Set-Cookie in BlackBerry Dynamics app

159 Views Asked by At

After upgrading to BlackBerry Dynamics for iOS (v10.1.0.36) cookies that previously were being set via the "Set-Cookie" header in the responses are no longer being set.

On performing some analysis we have found out that the WebView receives the cookies in the response. However its not being set in the WebView and the javascript cannot read the set cookies in the WebView. Even if we manually read the cookies from the Response and set them in the WebView the javascript is still unable to read the cookies.

We have also noticed that in the below mentioned Blog Post the very same issue we are facing is declared as fixed (in 10.1) so it has been a bit confusing how it is working in 10.0 but not in 10.1 https://devblog.blackberry.com/en/2022/01/blackberry-dynamics-sdk-v10-1-is-now-generally-available

1

There are 1 best solutions below

1
EK Choi On

Setting Cookies in the WKHTTPCookieStore was not supported in 10.0 as described below and its support was added in 10.1. https://docs.blackberry.com/en/development-tools/blackberry-dynamics-sdk-ios/10_0/blackberry-dynamics-sdk-ios-devguide/gwj1489687014271/Requirements-and-prerequisites-for-iOS-platform-features/owv1529436593184/WKWebView-unsupported-methods-and-properties

Could you confirm if your app is using a native WKWebView directly or else? You can post some code snippets around the issue here or reach out to BlackBerry Support in case this is a defect in 10.1.

Thanks,