问题
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