【问题标题】:On android first I am capturing cookie from webview, then removing the session cookie , then again setting the cookie在android上,我首先从webview捕获cookie,然后删除会话cookie,然后再次设置cookie
【发布时间】:2010-12-21 06:12:24
【问题描述】:
CookieManager   cookieManager = CookieManager.getInstance(); 
    String  cookie = cookieManager.getCookie(url);

cookieManager.removeSessionCookie();

 cookieManager.setAcceptCookie(true);
   cookieManager.setCookie( url, cookiestring);

删除 cookie 有效, 如何将 cookie 设置回 webview 并再次访问登录页面

提前致谢

【问题讨论】:

    标签: android cookies webview


    【解决方案1】:

    您必须使用 CookieSyncManager。从您的活动调用内部:

    cookieManager.setCookie(url, cookiestring);
    CookieSyncManager.createInstance(this).sync();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-15
      • 1970-01-01
      • 2013-09-12
      • 2011-03-31
      • 1970-01-01
      相关资源
      最近更新 更多