cordova-plugin-wkwebview-cookies
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

title: WKWebView Cookies description: Plugin to manage cookies in WKWebView (iOS).

cordova-plugin-wkwebview-cookies

Plugin to manage cookies in WKWebView. This is needed in order to fix cookies not stored in iframes in WKWebView.

Please notice that this plugin requires you to use WKWebView.

Installation

You can install the plugin using the following command:

cordova plugin add cordova-plugin-wkwebview-cookies

Methods

This plugin defines global WKWebViewCookies object.

Although in the global scope, it is not available until after the deviceready event.

function onDeviceReady() {
    console.log(WKWebViewCookies);
}

document.addEventListener("deviceready", onDeviceReady, false);

WKWebViewCookies.setCookie

Stores a cookie in the WebView. If you only want to store a cookie to make cookies in iframe work then you can store any name/value, just make sure that the domain belongs to the iframe domain.

Supported Platforms

  • iOS 11+

Quick Example

WKWebViewCookies.setCookie({
    name: 'CookieName',
    value: 'CookieValue',
    domain: 'example.edu'
}).then(function() {
    // Success.
}).catch(function() {
    // Error.
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    408
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    408
  • 1.0.0
    0

Package Sidebar

Install

npm i cordova-plugin-wkwebview-cookies

Weekly Downloads

408

Version

1.0.1

License

Apache-2.0

Unpacked Size

21 kB

Total Files

8

Last publish

Collaborators

  • alfonso-salces
  • dpalou
  • moodlepty
  • andrewnicols
  • noeldemartin