Hi,
i'm sending query with J2ME to http server. Every response has a Set-cookie header. On WTK and few other phones everything is OK, but on my Nokia N95 I cant find this header. What i do is:
I also tried with conn.getHeaderField("Set-cookie"/"set-cookie")); with no success. I also print every header with its value and I have got "cache-control" "date", "server", "content0length", "content-type" but no "set-cookie" header.Code:HttpConnection conn = (HttpConnection) Connector .open("http://url"); for (int i=0; ; i++) { String headerName = conn.getHeaderFieldKey(i); String headerValue = conn.getHeaderField(i); if (headerName == null && headerValue == null) { // No more headers break; } // jezeli trafiliśmy na ciastka to przetwarzamy if ("Set-Cookie".equalsIgnoreCase(headerName)) { String cookies = headerValue; break; } }
Can you tell me what am i doing wrong? How can I get the cookie value? It is very important for me because its ASP session Cookie.
Thank you in advance for help
P.S. Raw response from server:
Code:GET http://url HTTP/1.0 HTTP/1.1 200 OK Connection: close Date: Thu, 23 Apr 2009 08:14:45 GMT Server: Microsoft-IIS/6.0 Content-Length: 65 Content-Type: text/xml Set-Cookie: ASPSESSIONIDSQCBCRAR=OHBKPMODNJOABPOMICPFKENP; path=/ Cache-control: no-store <?xml version="1.0" encoding="UTF-8"?> <Y></Y>

Reply With Quote

