Questions tagged [android-cookiemanager]

CookieManager is a public class in the Android API that manages the cookies used by an application's WebView instances. Cookies are manipulated according to RFC2109.

54 questions
3
votes
1 answer

How should I test cookies for WebView Android?

I have a webview which loads the given URL (say google.com). I log in Google but after closing the WebView activity and restarting a new one, I assumed I will have to log in again, but I didn't. I have not yet set my Cookies, using CookieManager. I…
user2453055
  • 975
  • 1
  • 9
  • 19
3
votes
2 answers

Volley ignores Cookie header request

Good day! My app uses simple http client-server communication, established with Volley library on client side. First, i fire up an authorization request: public class AuthenticationRequest extends StringRequest { private static final String TAG…
2
votes
0 answers

Android CookieManager.setCookie doesn't sync across different process?

In Android, we can have different process (e.g. a Service in another process). However, I notice the CookieManager (from android.webkit.CookieManager) doesn't sync its newly set Cookie across the process. I have a function in the MainActivity that…
Elye
  • 53,639
  • 54
  • 212
  • 474
2
votes
1 answer

How to clean up the session created in a WebView?

I have a WebView instance which allows the user to authenticate and get access to some parts of the functionality provided by the web app. Once the user has finished their work with the WebView, we need to clean up the session for security…
aga
  • 27,954
  • 13
  • 86
  • 121
2
votes
1 answer

Xamarin Android CookieManager doesn't store all cookies

I am using Android Web View in my Xamarin Project to perform third party authentication. Once the login is successful I need to extract the authentication cookies. This cookies I am storing in persistent storage and then I am using them for passing…
2
votes
0 answers

Cannot get cookies set in library from CookieManager

I created a library that handles authentication, which I added as a dependency to my application. The library uses OkHttp to handle authentication, so I use a CookieJar to sync the cookies from the OkHttpClient instance with the Android…
Bryan
  • 14,756
  • 10
  • 70
  • 125
2
votes
2 answers

Where to find / browse cookies in app data folder?

I have my app ("myapp") with following example package signature: com.example.mycorp.myapp I browsed via adb shell the app folder /data/data/com.example.mycorp.myapp/ to find any cookies - in vain. Since I have WebView objects showing external links…
Ralf Wickum
  • 2,850
  • 9
  • 55
  • 103
2
votes
1 answer

CookieManager is abstract, cannot be instantiated. Why?

OkHttpClient client = new OkHttpClient(); CookieManager cookieManager = new CookieManager(); cookieManager.setCookiePolicy(CookiePolicy.ACCEPT_ALL); throws "CookieManager is abstract, cannot be instantiated" I'm importing…
VCUcompSci
  • 25
  • 5
2
votes
1 answer

Android Process Killed - is CookieManager instance killed?

Even though the android process is killed,the activity stack is maintained. For Example: I have crossed four screens in my app and cookies are stored in CookieManager. Now i am pressing the home button and the android kills the process.Since the…
1
vote
0 answers

Android Webview opens Chrome browser to accept Cookie

I want to show a Google Page in webview I have used these option mywebView.getSettings().setJavaScriptEnabled(true); CookieManager.getInstance().setAcceptCookie(true); CookieManager.getInstance().setAcceptThirdPartyCookies(mywebView, true); But…
Nico Lewis
  • 51
  • 1
  • 4
1
vote
2 answers

CookieManager.getCookie() always returns null (Version <= API 28 (Pie))

I use a standard android.webkit.Webview in a Java-Based native android app. Inside the Webview the User logs into a webapp. After successful login the webapp stores a cookie with the access token. I want to access this cookie. The cookie has the…
1
vote
1 answer

How to maintain session in WebView after exiting the application in Android?

I'm currently new to Android development but I'm trying to create a simple android app that opens up my website and allows you to log into it in WebView. However, I realized that when you exit the application and terminate its process and relaunch…
SimSandhu
  • 31
  • 2
  • 4
1
vote
0 answers

Android redirect to another page

I'm trying to redirect my user after successful authentication (using AJAX). I've tried using window.location.href and document.location but without success. I also want to keep the cookies. Here's my Android App code: WebView myWebView =…
GhoSTBG
  • 187
  • 1
  • 1
  • 11
1
vote
1 answer

Android CookieManager and Redirects

I'm setting two cookies using setCookie method from android.webkit.CookieManager - https://developer.android.com/reference/android/webkit/CookieManager.html with the same value for two different URLs. However, I know that when I load the first URL…
notGeek
  • 1,394
  • 5
  • 21
  • 40
1
vote
1 answer

Issue with cookie value not being encoded for cordova android app using Crosswalk

SETUP Currently, I have an cordova android application that uses crosswalk as the webview instead of the default chromium browser. The application itself access a AuthProvider during login and the cookies that are transmitted back from the…
darewreck
  • 2,576
  • 5
  • 42
  • 67