-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cookies/localStorage is not shared across WKWebView:s #68
Comments
This is blocking us too :/ |
Can you give more details about your environment? Does this only apply to wkwebview? Is it fine on Android and UIWebview ? Do you have multiples Webview a t the same time or only one that you close then reopen ? |
Hi! Some more info. We have an app with one main webview where, the user logs in. Then at times we overlay that webview with another webview, where the user needs to be logged in (so they are both open at the same time, and they are on the same domain). The webview displays fine, but the user is not logged in, in the overlaying webview. This is only the case for WKWebView, in UIWebView, and on Android, it just works. |
Ok, thanks for the details. If you want to start working on it I can review / merge pull requests 🚀 |
@epiceros @Titozzz found an improvable fix for this for now:
const cookies = await CookieManager.get('http://example.com')
CookieManager.set({
name: 'myCookie',
value: cookies.myCookie.value,
domain: cookies.myCookie.domain,
origin: cookies.myCookie.domain,
path: cookies.myCookie.domain.path,
version: '1',
expiration: cookies.myCookie.expiresDate
}, true) // <= true here!!! You might just need the |
Good insight, thanks |
Me again. WKWebview dosnt work like this. I've made several attempst to fix that on the react-native-wkwebview repo, but I failed every time. So, if anyone has any insight on this, I will gladly accept it Regards |
This should already be fixed here: CRAlpha/react-native-wkwebview@3e01629 Please consider replacing WKWebView with this better maintained version, per my suggestion here: #105 |
…rage are shared across webviews (react-native-webview#68)
I've raised a PR to fix this issue |
…are shared across webviews in iOS (#138) * fix(WKWebview): [iOS] Add shared process pool so cookies and localStorage are shared across webviews (#68) * Add optional shared process pool BREAKING CHANGE: useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
# [3.0.0](v2.15.0...v3.0.0) (2019-01-07) ### Features * **WKWebview:** Add shared process pool so cookies and localStorage are shared across webviews in iOS ([#138](#138)) ([afadc62](afadc62)), closes [#68](#68) ### BREAKING CHANGES * **WKWebview:** useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is still here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solutions and if you found one, please open a pull request! You have 7 days until this gets closed automatically |
…are shared across webviews in iOS (react-native-webview#138) * fix(WKWebview): [iOS] Add shared process pool so cookies and localStorage are shared across webviews (react-native-webview#68) * Add optional shared process pool BREAKING CHANGE: useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
# [3.0.0](react-native-webview/react-native-webview@v2.15.0...v3.0.0) (2019-01-07) ### Features * **WKWebview:** Add shared process pool so cookies and localStorage are shared across webviews in iOS ([react-native-webview#138](react-native-webview#138)) ([afadc62](react-native-webview@afadc62)), closes [react-native-webview#68](react-native-webview#68) ### BREAKING CHANGES * **WKWebview:** useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
# [3.0.0](react-native-webview/react-native-webview@v2.15.0...v3.0.0) (2019-01-07) ### Features * **WKWebview:** Add shared process pool so cookies and localStorage are shared across webviews in iOS ([#138](react-native-webview/react-native-webview#138)) ([afadc62](react-native-webview/react-native-webview@afadc62)), closes [#68](react-native-webview/react-native-webview#68) ### BREAKING CHANGES * **WKWebview:** useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
I opened an issue here:
facebook/react-native#21450
Is this something that needs to be addressed here as well?
The text was updated successfully, but these errors were encountered: