阅读的Android的WebView安全cookie [英] Reading secure cookies in android WebView
问题描述
我工作的一个Android的Web应用程序,如果一个安全的cookie存在我想做一些事情的基础上。不幸的是,当我使用code的以下行我只得到不安全的cookie的列表。
I am working on a android web application and based on if a secure cookie exists I want to do something. Unfortunately when I use the following line of code I only get a list of unsecure cookies.
String cookies = cookieManager.getCookie(siteName)
有谁知道我能得到的所有的安全Cookie的列表,针对特定领域?
Does anyone know how I can get a list of all secure cookies for a specific domain?
推荐答案
要解决这个问题我添加了以下我创建web视图之前
To resolve the issue I added the following before I created the webView
CookieManager.setAcceptFileSchemeCookies(真);
CookieManager.setAcceptFileSchemeCookies(true);
看<一个href=\"http://developer.android.com/reference/android/webkit/CookieManager.html#setAcceptFileSchemeCookies(boolean)\"相对=nofollow> CookieManager.setAcceptFileSchemeCookies(布尔接受)
这篇关于阅读的Android的WebView安全cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!