Gowtham
Gowtham

Reputation: 51

How to Manage Cookies?

I’m using the following code to launch a login page in my Flutter app via native Android code using CustomTabsIntent:

val customTabsIntent = CustomTabsIntent.Builder().build()
customTabsIntent.launchUrl(this, Uri.parse(loginUrl))

I want to manage cookies for the browser session opened using CustomTabsIntent. Specifically:

  1. Add cookies (e.g., session tokens) before launching the URL.
  2. Delete specific cookies or clear all cookies after the session.

I came across CookieManager in Android’s WebKit, but I’m unsure how to integrate it with CustomTabsIntent. Could someone guide me on how to:

  1. Set cookies before launching the URL.
  2. Delete existing cookies or clear cookies programmatically.

Upvotes: 0

Views: 19

Answers (0)

Related Questions