cookie header missing

回眸只為那壹抹淺笑 提交于 2019-12-10 22:44:49

问题


im calling a web service with ksoap,and i want to maintain the session within the web service, im trying to set the session cookie, but from the service response i dont get the session cookie with the session ID, im doing this:

URLConnection connection = new URL(url).openConnection();
String cookies = connection.getHeaderFields().toString();

and in the output there is no Cookie header, there are only these headers:

cache-contro=[private], content-type=[.....], server=[Microsoft-IIS/7.5], 
x-aspnet-version=[.....], x-powered-by=[ASP.NET], date=[......], 
content-length=[.....] }

I tested the service from a web browser and the session works, but doesnt return session cookie from an android app. Do u know wht is the problem??

Before my service method i have declared:

[ScriptMethod]
[WebMethod(EnableSession = true)]

Im using ksoap 2.6.1 library

来源:https://stackoverflow.com/questions/12713605/cookie-header-missing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!