-
-
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
Cookies dont persist #374
Comments
I can't reproduce this behavior on iOS Simulator. If you are using Could you share your code/use case? |
sure
|
I also have other inappwebviews in the widget tree that have incognito:true switched on, could that be the reason? |
Also zoomBy doesnt seem to work at all, my webview looks the same no matter how much or little i zoom it. |
I have confirmed the cookie problem only happens when I have multiple other webviews in the app @pichillilorenzo |
Which are instantiated before the google login one. |
I cannot reproduce your problem. On iOS Simulator, it is working fine!
Here is my full code example: import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
Future main() async {
WidgetsFlutterBinding.ensureInitialized();
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
InAppWebViewController _webViewController;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('InAppWebView Example'),
),
body: Container(
child: Column(children: <Widget>[
Expanded(
child: InAppWebView(
initialUrl: "https://accounts.google.com/AccountChooser?service=mail&continue=https://mail.google.com/mail/",
initialHeaders: {},
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
debuggingEnabled: true,
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",
javaScriptCanOpenWindowsAutomatically: true,
),
),
onWebViewCreated: (InAppWebViewController controller) {
_webViewController = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) async {
},
)),
Expanded(
child: InAppWebView(
initialUrl: "https://accounts.google.com/AccountChooser?service=mail&continue=https://mail.google.com/mail/",
initialHeaders: {},
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
debuggingEnabled: true,
userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",
javaScriptCanOpenWindowsAutomatically: true,
incognito: true
),
),
onWebViewCreated: (InAppWebViewController controller) {
_webViewController = controller;
},
onLoadStart: (InAppWebViewController controller, String url) {
},
onLoadStop: (InAppWebViewController controller, String url) async {
},
))
])),
),
);
}
} Screenshot: As you can see, in the first WebView, it remembers my account If I close the whole App and restart it, I see it as the screenshot every time. |
Ah well then I have no idea what is causing it in my code, thanks anyway |
I am also having this problem, it seems inconsistent. If I log into a google account, close the web view (not even the app) and reopen a webview I am no longer logged in. Incognito is set to false, and it just opens a browser and goes to mail.google.com so I'm not sure what I could be doing wrong here |
@scottk could you share the code you are using, please? Otherwise I cannot reproduce your error |
Hi no problem. It is now only happening on iOS, Android seems fine.
These are my common options
this is for the specific devices. I tried setting sharedCookies to false and true and neither changes. If the browser is destroyed (close app and reopen) the session is lost, not sure what else to try |
How u solve this please ? I have the same issue specially with cookies isSessiononly= true ,\ seems working fine on IOS simulator but not in real iphone device ? |
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. |
Environment
Flutter version: 1.17
Plugin version: 3.3.0+3
Android version:
iOS version:
Xcode version: 11.5
Device information:
Description
Expected behavior:
Cookies to persist on app restart.
Current behavior:
Cookies don't persist.
I sign into GMail on an in app browser and I get logged in and stay logged in, but when I restart the app I am not signed into gmail on the browser. Why?
The text was updated successfully, but these errors were encountered: