Question

4
Views
Close popover
Ruslan Maryasov (RuslanM4)
LANIT JSC

LANIT JSC
RU
RuslanM4 Member since 2017 1 post
LANIT JSC
Posted: March 29, 2021
Last activity: March 29, 2021

Unable to save third party cookies in the native iPad webview app

In the Pega SFA application we use control <iframe> for displaying other application. For in-app authentication inside the frame, we need to have a token with the domain of this application in cookies (screen 1). In order to set the necessary cookies, we make an AJAX request:

var xhr = new XMLHttpRequest();
xhr.open("POST", r_path, true);
xhr.setRequestHeader('Content-Type', 'text/plain;charset=UTF-8');
xhr.withCredentials = true;
var body = {
    "adToken": "<%=authToken%>"
};
xhr.send(JSON.stringify(body));

In response to the AJAX request we receive a set-cookie in headers (screen 2). When frame is requested, the token is passed in the cookie header. This works well on the desktop in Chrome, but doesn't work in the native iPad webview app. Also works in mobile Safari with "Prevent cross-site tracking" option disabled. How do we configure webview application to save third party cookies?

Pega 7.3.1 hybridclient-ios-7.41.6.0.zip xcode version 10.2.1 iPadOS 14.4.1

Pega Mobile Client 7.2.1 Mobile Senior System Architect