React Native Cookies interface for both platforms iOS and Android
npm install react-native-cookies-interface --save
or
yarn add react-native-cookies-interface
import CookiesInterface from 'react-native-cookies-interface';
const Cookies = new CookiesInterface('https://example.com/', '.example.com');
const { getCookie, clearCookies, setCookie } = Cookies;
Method | Params | Description |
---|---|---|
clearCookies | callback | Clears all cookies |
getCookie | callback | Get {cookie} and passes to Callback |
setCookie | options, callback | Set {cookie} |
{
domain: '.example.com',
path: '/',
name: 'some-cookie',
value: 'true',
origin: 'same origin'
version: 1
expiration: 'YYYY-MM-DD'
}