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

 【Android】setFromResponse method is not working v3.3.0 #134

Open
NaoyaKurahashi opened this issue Feb 19, 2019 · 1 comment
Open

 【Android】setFromResponse method is not working v3.3.0 #134

NaoyaKurahashi opened this issue Feb 19, 2019 · 1 comment

Comments

@NaoyaKurahashi
Copy link

We can't set cookies using setFromResponse method...

CookieManager.setFromResponse(
  'http://example.com', 
  'user_session=abcdefg; path=/; expires=Thu, 1 Jan 2030 00:00:00 -0000; secure; HttpOnly')
    .then((res) => {
      // `res` will be true or false depending on success.
      console.log('CookieManager.setFromResponse =>', res);
    });

In this code pass string cookie props to setFromResponse, but we can't set some cookies at once.

The reason why, in CookieManagerModule.java convert string cookies to string List, but converting List seems not working well.

If we will set some cookies...

we must call setFromResponse method  some times same as cookies length.

This code work.

CookieManager.setFromResponse(
  'http://example.com', 
  'user_session=abcdefg;')
    .then((res) => {
      // `res` will be true or false depending on success.
      console.log('CookieManager.setFromResponse =>', res);
    });
@NaoyaKurahashi NaoyaKurahashi changed the title setFromResponse method is not working v3.3.0  【Android】setFromResponse method is not working v3.3.0 Feb 19, 2019
@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

2 participants