Closed dahjelle closed 6 years ago
I have verified that the other cookies are in the WebView
using Chrome's remote debugger.
To put some details on my previous comment, here's what Chrome's remote debugger shows me:
Whereas this code
CookieManager.get('https://david-rubix.iconcmo.com/').then(
console.log.bind(console, 'cookies')
);
gives me
Hmm…I turned off the SameSite
attribute server-side, and then I had access to all the cookies. This is apparently not an issue of either react-native-cookies
or even react-native
, but looks to be an issue of the Android WebView, at least according to this StackOverflow post.
thanks for this analysis @dahjelle
You bet!
For whatever it is worth, I posted a couple bug reports about this issue:
Do you think, @joeferraro, it'd be worth adding a note to the docs about this issue?
I have a React Native app with a
WebView
. I log in to the web view, and then was hoping I could see all the cookies that theWebView
uses by something like:But I'm only getting a subset of the cookies that I think must be in the
WebView
. (i.e. the web app requires 3 or 4 cookies for authentication, and has them when I look in a desktop browser)I'm at a loss as to why this might be happening. Does the
WebView
andcookieHandler
only sync periodically? Does Android only allow access to, sayhttpOnly
cookies (though that doesn't appear to be what is happening here)? It should support sub-domains? (None of these appear to be the issue as far as I can tell…) Thoughts?I added a
System.out.println
toCookieManagerModule.java
, in theget
method, and it appears that the Cookie information that is coming from React Native isn't complete, either.I tried to add some logging to
ForwardingCookieHandler.java
, but I haven't had any luck getting them to appear. I'm guessing that React Native isn't getting recompiled for some reason…I'm happy to dig into this a bit if someone has a pointer or two. :-D I'm mostly a JS dev so it takes a bit more work to understand what Java is doing.