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

Cookies not being removed #2

Closed
menelike opened this issue May 18, 2021 · 3 comments
Closed

Cookies not being removed #2

menelike opened this issue May 18, 2021 · 3 comments

Comments

@menelike
Copy link
Member

menelike commented May 18, 2021

With the new Proxy on iOS we can workaround ITP, but removing cookies does not work at all (no timing/await/async issue).

Simulator Screen Shot - iPhone 12 Pro Max - 2021-05-18 at 21 59 43

Also, the callbacks don't work (cookies are being cleared asynchronously), see

cookieTest/client/main.js

Lines 142 to 144 in f9750c6

// Todo: callback not fired
// CDVPluginResult *pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK]; should be used
// await new Promise((resolve, reject) => window.WebviewProxy.clearCookie(resolve, reject));

and

https://github.com/GEDYSIntraWare/cordova-plugin-webview-proxy/blob/0e5bfc9274759e0a2af9c89072a59a7230c9dc15/src/ios/WebviewProxy.m#L107

Unfortunately, the completionHandler is not being used, so this resolves the issue with the callback not being called, but the async issue needs to be tackled as well.

@dr-dimitru
Copy link

Hello @menelike ,

Thank you for testing and opening this one. Got a few questions:

  1. What's "ITP"?
  2. Could you point me to document or briefly describe how to launch an app in 2021 (real device/sim)?
  3. Android remained intact?

@menelike
Copy link
Member Author

menelike commented May 19, 2021

Hi @dr-dimitru,

it's been a while, nice to see/hear you 😀

  1. What's "ITP"?

ITP stands for Intelligent Tracking Prevention. In short, it means that cross-site cookies are not allowed.
This should usually be no issue for us as we only use one domain, but in Meteor we use localhost (internal Meteor webapp caching server) and our real domain together. As a result, iOS won't reply with server set cookies anymore.
In theory, we should able to use app-bound-domains to tackle this, but I could not get this to work.

I am still not sure if this could be just a configuration issue, but since Meteor itself does not use cookies there won't be any support for this on the Meteor side.
One thing I absolutely don't understand is that with Meteor sticky sessions set by load balancers should not work anymore as well (this should be actually an interest for Meteor).

Those two links explain the issue very well:

apache/cordova-ios#922
https://blog.merzlabs.com/posts/webview-history/

  1. Could you point me to document or briefly describe how to launch an app in 2021 (real device/sim)?

Actually npm run start:ios should do the job if you've set up all prerequisites. Of course this only works on mac. npm run start:android runs this on Android (not only on mac of course).
Also, make sure to use Xcode >= 12.x (which is also required for the app store since April this year, prior a temporary workaround to this issue was to use Xcode 11.x)

  1. Android remained intact?

I need to fix the tests for Android, but nothing has changed there yet. We can expect Android add something similar to ITP. Hopefully the same approach will work on Android as well GEDYSIntraWare/cordova-plugin-webview-proxy#1


If you need help to setup/run this project on iOS feel free to ask, I'm glad to help out.

@menelike
Copy link
Member Author

menelike commented Jun 1, 2021

This issue has been solved in GEDYSIntraWare/cordova-plugin-webview-proxy#15

@menelike menelike closed this as completed Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants