-
Notifications
You must be signed in to change notification settings - Fork 936
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
Unable to get HTTPOnly cookies iOS #336
Comments
Is not possible to retrieve HttpOnly cookies with Javascript:
https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies The only way to get these cookies is directly from the Android/iOS webviews. So for Android it would be And for iOS (11+) https://developer.apple.com/documentation/webkit/wkhttpcookiestore/2882005-getallcookies |
Thanks for the reply. I agree with you, httponly cookies needs to be protected. I have zero knowledge on iOS development. Do i need to configure anything or set WKHttpCookieStore in the app delegate so that flutter is able to fetch the cookies? By default, if i just call the method below, it doesnt fetch anything on iOS:
|
Basically you would need to implement the functionality in the native classes for both iOS ( The method you mentioned |
Thanks! It works! I use this as reference and invoke my own method and call it: |
@fadhlisulaimi since you've implemented this, any chance for PR to the plugin? :) |
Hi! Thank you for pr, I will try to do that in reasonable time. Please note that project is in freeze state and if it's possible, please migrate to official web view plugin |
@charafau I will do |
I have an app that fetches cookies after user login to forum in webview. I am unable to fetch httponly cookies on iOS. It works perfectly in Android. When i look at the source code, document.cookie is injected. Perhaps it is not enough for iOS as it uses WKWebview? It seems Apple stores the cookies in NSHTTPCookieStorage.
Future<Map<String, dynamic>> getCookies()
final cookiesString = await evalJavascript("document.cookie");
The text was updated successfully, but these errors were encountered: