如果使用easyui框架和xutil框架,那么我们怎么去获得服务器返回的cookie呢

DefaultHttpClient client=(DefaultHttpClient) httpUtils.getHttpClient();
                        List<Cookie> cookies= client.getCookieStore().getCookies();
                        for (int i = 0; i < cookies.size(); i++) {
                            if(cookies.get(i).getName().equals("JSESSIONID")){
                                String cookie=cookies.get(i).getValue();
                                sp.edit().putString("JSESSIONID", cookie).commit();
                            }
                            break;
                        }


你可能感兴趣的:(httpclient,cookie,xutil)