-
Notifications
You must be signed in to change notification settings - Fork 314
Added 'set' method for android #123
base: master
Are you sure you want to change the base?
Conversation
@joeferraro Please merge this pull request, if it has no problem. |
@joeferraro Please bump! |
@echo8795 , Thanks for the PR. I tried to use your master branch, the same code works well with react-native-webview on iOS when sharedCookiesEnabled is true.The cookie was accepted by login server, the login process bypassed. However it still needs login on Android, do you have any knowledge about it? Thanks again |
|
||
private void setCookie( String url, String value ) throws URISyntaxException, IOException { | ||
URI uri = new URI(url); | ||
Map<String, List<String>> cookieMap = new HashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map cookieMap = new HashMap<String, List<String>>();
is better looks like than that.
After the comments, I compared the cookie content to the one on iOS, they were different, then I found the issue of RN can only pass one cookie on Android. After I apply the work around (https://facebook.github.io/react-native/docs/network.html#known-issues-with-fetch-and-cookie-based-authentication), unfortunately the login page still can't bypass |
I have forked the repo here: https://github.com/safaiyeh/react-native-cookie-store |
adding the
set
cookie method for android by using react-native'sForwardingCookieHandler
class