Skip to content
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

cannot set cookies on webview #34

Closed
bvedam opened this issue Jan 2, 2019 · 2 comments
Closed

cannot set cookies on webview #34

bvedam opened this issue Jan 2, 2019 · 2 comments

Comments

@bvedam
Copy link

bvedam commented Jan 2, 2019

Flutter version: 1.0.0+1
flutter_inappbrowser: ^0.5.51
Testing devices: android (OS v7.0)

Hi - I am setting cookies on initState and building widget on cookies set, but the webview doesn't seem to have the cookies. I don't know how to call await CookieManager.getCookies(baseUrl) inside the build Widget method. Could you help me explain what's going on and why cookies are not being set. Thanks.

initState() {
super.initState();
setSessionCookies(sessionCookies);
}

Future setSessionCookies(String cookies) async {
baseUrl = "https://mysite.com";
await CookieManager.setCookie(baseUrl, name, val);
setState(() {
sessionCookiesSet = true;
});
}

@OverRide
Widget build(BuildContext context) {
return Container(child: sessionCookieSet? InAppWebView( initialUrl: baseUrl ) : CircularProgressIndicator())
}

@bvedam
Copy link
Author

bvedam commented Jan 2, 2019

False Alarm. Realized the cookie was not being set because of expiration date. So everything works as expected.

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant