How I can get http-only and secure cookies on android device
See original GitHub issueHello guys,
I’m current build a RN app with react-native-webview and @react-native-community/cookies. Now, i need to access all cookies in webview. With some help of @react-native-community/cookies on ios devices, i can get all of this but on android i only get non-secure/non-httpOnly cookies.
Android devices is running on API 28.
Here my code:
- Implement webview
<WebView ref={webViewRef} source={{uri: 'https://example.com'}} javaScriptEnabled={true} sharedCookiesEnabled={true} thirdPartyCookiesEnabled={true} />
- Get cookies
useEffect(() => { let getCookies = () => CookieManager.getAll(useWebKit).then((cookies) => { console.log('CookieManager.get =>', cookies); }); if (Platform.OS === 'android') { getCookies = () => CookieManager.get('https://linkedin.com').then((cookies) => { console.log('CookieManager.get =>', cookies); }); } getCookies(); }, []);
Issue Analytics
- State:
- Created 3 years ago
- Reactions:9
- Comments:20
Top Results From Across the Web
Access http-only or secure cookies on Android devices React ...
Try: CookieManager.setAccessCookie(true).
Read more >HttpCookie - Android Developers
Returns true if this cookie contains the HttpOnly attribute. This means that the cookie should not be accessible to scripting engines, like javascript....
Read more >Turn cookies on or off - Android - Google Account Help
On your Android phone or tablet, open the Chrome app Chrome . · At the top right, tap More More and then Settings....
Read more >Securing cookies with httponly and secure flags [updated 2020]
Security of cookies is an important subject. HttpOnly and secure flags can be used to make the cookies more secure. When a secure...
Read more >Securing Your Cookies: HTTPOnly Flag for Cookie Theft ...
According to OWASP (Open Web Application Security Project ), “The HttpOnly cookie attribute instructs web browsers not to allow scripts ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hengkx Ios still can get httpOnly cookie, try to use
CookieManager.getAll(true).then(...)
.I tried and it does not work 😃