-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
HttpOnly Cookies #11
Comments
Unfortunately, there is no way to get HttpOnly cookies. In case, you can set cookies that will be used by the WebView using the await CookieManager.setCookie("https://flutter.io/", "myCookieName", "myCookieValue"); |
The fact is that I need to get a token (that's stored as a HttpOnly cookie) on the WebView and use it to request some info on the server. |
The problem is that WebViews don't give access to HttpOnly cookies. import 'dart:io';
import 'dart:async';
Future main() async {
String token;
HttpClient client = new HttpClient();
client.getUrl(Uri.parse("<HERE_MY_URL>")) // or client.postUrl
.then((HttpClientRequest request) {
// Optionally set up headers...
// Optionally write to the request object...
// Then call close.
return request.close();
})
.then((HttpClientResponse response) {
// Process the response.
List<Cookie> cookies = response.cookies;
print(cookies);
// Loop the cookies to search your specific cookie with the token
for (var cookie in cookies) {
if (cookie.name == "<MY_COOKIE_NAME>") {
token = cookie.value;
print(token);
break;
}
}
});
} In this way you can get your token and then you can use it for your next requests. Let me know if it works. |
…lve_the_issue_webview_bottom_bar_is_shown_for_iOS_12.3_and_later_versions TWECACAPP-637 solve the issue webview bottom bar is shown for iOS 12.3 and later versions
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
Hey,
I was wondering if there was a way to get the HttpOnly cookies or is it possible to share the session with a http request ?
The text was updated successfully, but these errors were encountered: