cordova-plugin-wkwebview-sync-cookies

Cordova plugin to sync cookies in a WKWebView

Usage no npm install needed!

<script type="module">
  import cordovaPluginWkwebviewSyncCookies from 'https://cdn.skypack.dev/cordova-plugin-wkwebview-sync-cookies';
</script>

README

cordova-plugin-wkwebview-sync-cookies

This works around an issue in WKWebView where cookies are not readable or settable in AJAX requests on the first app install. Executing the plugin at the specified URL will allow the server to set cookies on the client.

Usage

document.addEventListener('deviceready', () => {
  const args = ['GET', 'https://my.site.com'];
  cordova.exec(null, null, 'WKWebViewSyncCookies', 'sync', args);
});