android客户端可以获得服务器session中的值吗
1个回答
展开全部
发送sessionid到服务器
HttpPost request = new HttpPost(url);
request.setHeader("Cookie", "JSESSIONID="+sessionId);
获取服务器返回的sesionid
DefaultHttpClient client = new DefaultHttpClient();
CookieStore mCookieStore = client.getCookieStore();
List<Cookie> cookies = mCookieStore.getCookies();
然后遍历下cookies就能找到JSESSIONID了
HttpPost request = new HttpPost(url);
request.setHeader("Cookie", "JSESSIONID="+sessionId);
获取服务器返回的sesionid
DefaultHttpClient client = new DefaultHttpClient();
CookieStore mCookieStore = client.getCookieStore();
List<Cookie> cookies = mCookieStore.getCookies();
然后遍历下cookies就能找到JSESSIONID了
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询