[Questions]: How can get cookie which is set in webview in react-native?
See original GitHub issueI am trying to retrieve user entered zipcode which is added to the cookie in the webview. How do I get it? I have tried react-native-cookies which is getting an empty object not the user entered zipcode.
import CookieManager from 'react-native-cookies';
componentWillMount() {
CookieManager.get('https://www.example.com')
.then((res) => {
console.log('CookieManager.get from webkit-view =>', res);
});
}
}
<WebView
style={styles.webview}
source={{ uri: 'https://www.example.com' }}
injectedJavaScript={INJECTED_JAVASCRIPT}
mixedContentMode="compatibility"
javaScriptEnabled
domStorageEnabled
thirdPartyCookiesEnabled
sharedCookiesEnabled
originWhitelist={['*']}
/>
I am trying out in iOS simulator. I see https://github.com/react-native-community/react-native-webview/pull/175 as merged but cant figure out how to use it.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
How can get cookie which is set in webview in react-native ...
I have tried react-native-cookies which is getting an empty object not the user entered zipcode. import CookieManager from 'react-native-cookies ...
Read more >How can get cookie which is set in webview in react-native?
You can try the following trick without using any native modules. just go through the Code or URL. // @flow import React, {...
Read more >@react-native-cookies/cookies - npm
Start using @react-native-cookies/cookies in your project by running `npm i @react-native-cookies/cookies`. There are 11 other projects in ...
Read more >How to communicate with data between WebViews in React ...
First, go to the terminal and create a react-native application. npx react-native init webviewdata ... How to send data from WebView to a...
Read more >set-cookie header not working react - You.com | The AI Search ...
You can't set cookies for another domain, as it would be a huge security problem to do so. In your case, the first...
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
You can use the
injectedJavaScript
orinjectJavaScript
method as per the documentation@TiagoHellebrandt Can’t get HTTPOnly Cookies