Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

got undefined on set cookie response #162

Open
rahultatvasoft opened this issue Oct 25, 2019 · 3 comments
Open

got undefined on set cookie response #162

rahultatvasoft opened this issue Oct 25, 2019 · 3 comments

Comments

@rahultatvasoft
Copy link

rahultatvasoft commented Oct 25, 2019

@joeferraro

"react": "16.8.6",
"react-native": "0.60.4",
"react-native-cookies": "^3.3.0",

import CookieManager from 'react-native-cookies';

CookieManager.set({
name: 'myCookie',
value: 'myValue',
domain: 'some domain',
origin: 'some origin',
path: '/',
version: '1',
expiration: '2015-05-30T12:30:00.00-05:00'
}).then((res) => {
console.log('CookieManager.set =>', res); // undefined
});

@chauduong1192
Copy link

I have the same issue with @rahultatvasoft. Any idea ? Thanks.

@krakz999
Copy link

The set method in the native module returns nil in every situation (whether it was a success or not), that's why it returns undefined in JS.

You can see here:
RNCookieManagerIOS.m / line 38
resolve(nil);

You can use the CookieManager.get and CookieManager.getAll (this one only on iOS) methods to get the cookies from storage and verify if the cookie was saved successfully.

@safaiyeh
Copy link

safaiyeh commented Jan 2, 2020

I have forked the repo here: https://github.com/safaiyeh/react-native-cookie-store
We can create issues and PRs there to continue the development of the project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants