Open mallikarjunakp opened 8 years ago
try change there
CookieManager.default.set(map,(res) => {
alert("Set cookie"+res);
});
to
CookieManager.set(map,(res) => {
alert("Set cookie"+res);
});
I have done that before.
But it says undefined is not a function evaluating the CookieManager.set
And then i debugged and consoled the CookieManager object,
I have got to know that set function is inside default object. So i changed.
It works and gives me that success
.
But when i do getAll
, i am getting no result
HI, thanks for the reply, I am sorry that i didn't observe the flow. Now i am able to set and get the cookies. but once the app is restart then cookies are gone. Is n't it persistent ?
you mean callback(res) ?
No. What I meant was, I did set the cookie, and then cookies are available throughout the app. But once i close the app and open it again, and try to access the cookies, they are no more. So the persistent problem :(
After the repair finished bug I'll release a new version
@mallikarjunakp I made the following changes
set(options,callback) -> setCookie(options)
getAll(callback) -> getCookie()
clearAll(callback) -> removeAllCookies()
v0.2.0
Hello, same problem on Android: When I pass following data to setCookie:
{
domain:"https://example.com/"
expiration:""
name:"auth"
origin:"same origin"
path:"/"
value:"1"
}
I got following from getCookie (parsed):
{auth:"0", ...}
Here is my code: https://gist.github.com/iegik/21633e999aa653b0f046cc31138cdc5b
PS: I write my own mixed class from both react-native-cookies and react-native-cookiemanager
Update:
{
domain:""
expiration:""
name:"auth"
origin:""
path:""
value:"1"
}
Do You check these properties for empty value?
Hi, I have used the code as you explained. Please check the issue that i am getting.
Here is my code,
var options = { name: 'username', value: 'abcdefg', domain: 'http://localhost:8081/', origin: 'http://localhost:8081/', path: '/', expiration: 'Thu, 18 Dec 2016 12:00:00 UTC', };
CookieManager.default.set(options,(res) => {
alert("Set cookie"+res);
});
I am executing this on click of a button for testing.
Then i am using the below code to get cookie
CookieManager.default.getAll((res) => {
alert(JSON.stringify(res));
});
But then the cookie is null. it alerts me this
{}