Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WKWebview cookie sometimes can't be get after upgrade to Cordova 6.1.0 #751

Closed
3 tasks done
xinhuadian opened this issue Jul 7, 2020 · 7 comments · Fixed by #825
Closed
3 tasks done

WKWebview cookie sometimes can't be get after upgrade to Cordova 6.1.0 #751

xinhuadian opened this issue Jul 7, 2020 · 7 comments · Fixed by #825
Assignees
Milestone

Comments

@xinhuadian
Copy link

Bug Report

Problem

Try to get the cookie of inappbrowser. But sometimes can't get correct cookie.
This issue happen after upgrade cordova to Cordova ios 6.1.0. and inappbrowser upgrade to 4.0.0

What is expected to happen?

Use blow code to get cookies in decidePolicyForNavigationAction of CDVWKInAppBrowser

WKHTTPCookieStore wkWebViewCookieStore =[[[theWebView configuration] websiteDataStore] httpCookieStore];
[wkWebViewCookieStore getAllCookies:^(NSArray
wkcookies) {
for (NSHTTPCookie* cookie in wkcookies)
{
NSLog(@"wk cookie name is %@",cookie.name);
}
}];

What does actually happen?

Some times the wkcookies can't get the correct cookie.
And this issue not always happen, but sometimes. in my test ,50% percentage happen.

Information

This issue not happen after downgrade the cordova ios to 5.1 and still use inappbrowser 4.0.0(after resolve some compile error).

Command or Code

Please see above

Environment, Platform, Device

Cordova 9.0.0, Cordova ios 6.1.0, xcode 11.5.
Iphone simulator(13.5) and Iphone X (13.5)

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@xinhuadian
Copy link
Author

I just find the cause of this issue.
Inappbrowser 4.0.0 still use below code
#if __has_include("CDVWKProcessPoolFactory.h")
#import "CDVWKProcessPoolFactory.h"
#endif
CDVWKProcessPoolFactory should modify to CDVWebViewProcessPoolFactory
Wish next version can have this issue fixed.

@NiklasMerz
Copy link
Member

Thanks for reporting. Good find!

Sounds like an issue in inappbrowser. I am transfering this to the inappbrowser repo.

@NiklasMerz NiklasMerz transferred this issue from apache/cordova-ios Jul 9, 2020
@NiklasMerz NiklasMerz added this to the 4.0.1 milestone Jul 9, 2020
@mitsoe
Copy link

mitsoe commented Sep 16, 2020

Hey @NiklasMerz , any timeline for the 4.0.1 release?

@NiklasMerz
Copy link
Member

Sorry we don't give any release dates. This issue is not addressed yet. Pull requests welcome.

@NiklasMerz NiklasMerz self-assigned this Nov 25, 2020
@NiklasMerz NiklasMerz modified the milestones: 4.0.1, 5.0.0 Nov 25, 2020
@NiklasMerz
Copy link
Member

I am now affected by this problem. I am working on a pull request right now.

Seems like the new CDVWebViewProcessPoolFactory is not public and the imports won't work the same. I just need to figure out how to solve this and this may require an updated version of cordova-ios.

@XandiKarlen
Copy link

XandiKarlen commented Nov 25, 2020

@NiklasMerz We also had a problem just recently with managing the session cookie between different instances of the InAppBrowser. What we did was changing up the import in the CDVWKInAppBrowser.m to use
../../../CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewProcessPoolFactory.h instead of the one currently used and also change the instance of the sharedFactory object.

Maybe this will help

@NiklasMerz
Copy link
Member

I found a fix but this also requires a fix in cordova-ios. Let's see how the reviews go there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants