Hi Andreas,

https://lists.crosswalk-project.org/pipermail/crosswalk-dev/2015-March/002552.html

Our developer Xu Xing tried the following test code succeeded and test case 
CookieManagerTest got all pass on latest crosswalk master.

        private void CookieTest () {
                XWalkCookieManager cookieManager = null;
                cookieManager = new XWalkCookieManager();
                cookieManager.setAcceptCookie(true);
                final String url = "http://www.example.com";;
                final String cookie1 = "cookie1=peter";
                final String cookie2 = "cookie2=sue";
                final String cookie3 = "cookie3=marc";
                // Session cookie.
                cookieManager.setCookie(url, cookie1);
                cookieManager.setCookie(url, cookie2);
                cookieManager.setCookie(url, cookie3);
                String allCookies = cookieManager.getCookie(url);
                Log.i(TAG,"CookieTest:"+allCookies); //Output: 
CookieTest:cookie1=peter; cookie2=sue; cookie3=marc
        }

We need call CookieTest after new XWalkView.

Could you please try it?

BR
Belem

-----Original Message-----
From: Crosswalk-help 
[mailto:[email protected]] On Behalf Of 
Andreas Hegenberg
Sent: Thursday, January 22, 2015 10:55 PM
To: [email protected]
Subject: [Crosswalk-help] Setting cookies in Crosswalk via Java

Hello,

I need to make Crosswalk on Android (in a Cordova project) use some cookies I 
gathered via an Apache HttpClient.
However I'm not sure how to achieve this. I tried experimenting with the 
XWalkCookieManager but I think everything I do with the XWalkCookieManager is 
ignored. Where would I initialize the cookie manager?

//cookieStore contains the cookies I got via a request from the Apache 
HttpClient.
 List<Cookie> cookies = cookieStore.getCookies();  for (int i = 0; i < 
cookies.size(); i++) {
       Cookie cookie = cookies.get(i);
       cookieManager.setCookie(cookie.getDomain(),cookie.getValue());
  }

I would really appreciate any help, this is the only thing that currently keeps 
me from using Crosswalk successfully.

Best,
Andreas
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to