Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-cookies

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-cookies

Cordova Cookies Plugin

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
214
decreased by-34.15%
Maintainers
1
Weekly downloads
 
Created
Source

cordova-plugin-cookies

npm version MIT Licence

This plugin returns the cookies from the webview for a specific url so the cookies can be used e.g. to get the cookies from cordova-plugin-inappbrowser and pass it to cordova-plugin-advanced-http.

Installation

cordova plugin add cordova-plugin-cookies

Supported Platforms

  • Android
  • iOS

Limitations

It doen't work with the UIWebView on iOS (It's deprecated by Apple).

Usage

Plain

// get cookie string from webview
window.cordova.plugins.CookiesPlugin.getCookie(url, (cookies) => {
  // log cookies
  console.log(url, cookies);
});

Extended

// create in app browser
const iab = this.inAppBrowser.create(url, "_blank");

// check for cookies on every loadstop
iab.on("loadstop").subscribe(() => {
  // get cookie string from webview
  (window as any).cordova.plugins.CookiesPlugin.getCookie(
    url,
    async (cookies: string) => {
      // set cookies to http plugin
      cookies.split(";").forEach((cookie) => {
        this.http.setCookie(url, cookie);
      });

      // check if connected
      if (await this.isUserAuthenticated()) {
        iab.close();
      }
    }
  );
});

Keywords

FAQs

Package last updated on 20 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc