iegik / react-native-cookies-interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm version

react-native-cookies-interface

React Native Cookies interface for both platforms iOS and Android

Installation

npm install react-native-cookies-interface --save

or

yarn add react-native-cookies-interface

Usage

import CookiesInterface from 'react-native-cookies-interface';

const Cookies = new CookiesInterface('https://example.com/', '.example.com');
const { getCookie, clearCookies, setCookie } = Cookies;

API

Method Params Description
clearCookies callback Clears all cookies
getCookie callback Get {cookie} and passes to Callback
setCookie options, callback Set {cookie}

Cookie object

{
    domain: '.example.com',
    path: '/',
    name: 'some-cookie',
    value: 'true',
    origin: 'same origin'
    version: 1
    expiration: 'YYYY-MM-DD'
}

Dependencies

About


Languages

Language:JavaScript 46.8%Language:Objective-C 31.3%Language:Python 12.2%Language:Java 9.7%