How to share cookies on custom chrome android tabs

We have an Android app in which we want to open a URL. In order to avoid re-entering the username and password, we want to send session cookies. We can use webview inside our application to do this, but we want to avoid webviews.

Another solution we found is to use custom chrome tabs. According to the documentation https://developer.chrome.com/multidevice/android/customtabs custom chrome tabs support:

Sharing the Cookie Jar and permission model so that users don’t have to register on sites they are already connected to or re-grant the permissions that they have already granted.

I am trying an example from https://github.com/GoogleChrome/custom-tabs-client But I cannot figure out how to transfer session data.

Can someone help me by pointing out documentation or a way to achieve this?

+7
android google-chrome cookies
source share
2 answers

A shared cookie means that the user tab shares the corn with Chrome. Currently, it is not possible to set cookies from an application inside a user tab.

On the other hand, you can check Smart Lock for Passwords , which allows you to automatically register through applications and websites (and will work in the user’s tab)

+6
source share

This feature seems to be what the Chromium team wanted to do, but not yet implemented. Here is a report error / request function that offers a possible workaround.

0
source share

All Articles