You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/01/17 13:20:07 UTC

[GitHub] [cordova-ios] girish2711 commented on pull request #1004: Proxy requests through WKURLSchemeHandler to bypass Cookies and ITP restrictions

girish2711 commented on pull request #1004:
URL: https://github.com/apache/cordova-ios/pull/1004#issuecomment-761811683


   @NiklasMerz  Thanks for the WKURLSchemeHandler implementation. I took #1030 PR and integrated with your plugin https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy. Also changed the URL per your suggestion. All my XHR calls are now directed to webiewproxy.m and completes with proper response.
   
   However, in my case my API responds with a few session cookies and I don't see them getting synced to my Cordova main web view. I see cookies in native cookie store but not in Cordova main web view. Is this expected ? Any solution to this?
    
   I have a Single Sign On implementation which needs these session cookies to be sent along with http GET URL request (window.location = url to a subdomain) to a my own server. But the request is sent without cookies and hence it fails. 
   
   I tried by configuring CDVWebViewEngine's webdatastore to a nonPersistant one and added cookies to the same store as in below, but that didn't sync cookie to Cordova Main webview
   
   first added app bound domain in the info.plist
   
   and then in CDWebViewEngine:77. 
   
       
   if (@available(iOS 14.0, *)) {
            
        configuration.limitsNavigationsToAppBoundDomains = YES;    
        WKWebsiteDataStore *dStore =[[CDVWebViewProcessPoolFactory sharedFactory] sharedDataStore]; // by adding new method in sharedFactory
   
           configuration.websiteDataStore = dStore; 
       } else {
           // Fallback on earlier versions
       }
   
   
   and in webviewproxy.m:40
   
       WKWebsiteDataStore* dataStore = [[CDVWebViewProcessPoolFactory sharedFactory] sharedDataStore];
           WKHTTPCookieStore* cookieStore = dataStore.httpCookieStore;
   
   
   Any idea if cookies are not meant for syncing or am I missing something ? I am testing in iOS14 with XCode 12.3. 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org