# cordova-plugin-cookie-polyfill

> This plugin enables the management of cookies in WebViews on iOS and Android as those platforms restrict the use of "document.cookie".

Latest version **1.3.1** (published 2019-09-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-cookie-polyfill
pnpm add cordova-plugin-cookie-polyfill
yarn add cordova-plugin-cookie-polyfill
bun add cordova-plugin-cookie-polyfill
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.1 |
| Published | 2019-09-15 |
| First published | 2019-09-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 14.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Kevin Kelchen |
| Maintainers | speige |
| Keywords | cordova, phonegap, cookie, cookies, cookie-manager, cookie-plugin, ecosystem:cordova, cordova-ios, cordova-android |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-cookie-polyfill
- Repository: https://github.com/speige/cordova-plugin-cookie-polyfill
- Issues: https://github.com/speige/cordova-plugin-cookie-polyfill/issues
- npm.io page: https://npm.io/package/cordova-plugin-cookie-polyfill

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.3.1 (latest) — 2019-09-15
- 1.3.0 — 2019-09-15

## README

Cookie Master
==============

As you may already know, WebViews on Android and iOS platforms do not support regular use of <code>document.cookie</code> for managing the cookies in your app. This plugin allows you to get and set cookie values from your WebView through a simple interface.

## Supported Platforms
* Android
* iOS

## Installing

Install with Cordova CLI

    $ cordova plugin add cordova-plugin-cartegraph-cookie-master

## Usage
### Get cookie value
```javascript
cookieMaster.getCookieValue('http://<some host>:<some port>', '<cookie name>', function(data) {
  console.log(data.cookieValue);
}, function(error) {
  if (error) {
    console.log('error: ' + error);
  }
});
```
### Set cookie value
```javascript
cookieMaster.setCookieValue('http://<some host>:<some port>', '<cookie name>', '<cookie value>',
    function() {
        console.log('A cookie has been set');
    },
    function(error) {
        console.log('Error setting cookie: '+error);
    });
```
The cookie value should be formatted just like a regular <code>document.cookie</code> value.

### Clear all cookies
```javascript
cookieMaster.clearCookies(
    function() {
    console.log('Cookies have been cleared');
    },
    function() {
        console.log('Cookies could not be cleared');
    });
```

## Limitations
* This version has been tested on Android 4.4 ~ 5.1 devices, iOS 7.1 ~ 9 devices. Experience may vary for different OS versions.


## License
This plugin is distributed under the MIT License.

## Thanks to
This plugin is a fork of Edward Gao's "cookie master" plugin which was forked from Kristian Hristov's "cookie master" plugin. This fork is adding partial WKWebView support.

This plugin was inspired by the great work on the CookieMonster plugin by @barrettc

---
_Source: https://npm.io/package/cordova-plugin-cookie-polyfill · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
