×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    Question Set-Cookie header not found

    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:

    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;
                    }
                }
    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.

    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>
    Last edited by a.wasilewski; 2009-04-23 at 09:16.

  2. #2
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    Re: Set-Cookie header not found

    Anybody can help?

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Set-Cookie header not found

    I don't know the answer.

    However... this guy says he is getting set-cookie headers on his N95. Several of them, in fact.

    You say it works on other phones... is there any difference in network, or configuration (access point name, etc.)? I'm wondering if the network could be interfering with the response.

    You may also be able to see network interference when the request hits your server (take a look at the request header).

    Graham.

  4. #4
    Registered User
    Join Date
    Apr 2009
    Posts
    3

    Re: Set-Cookie header not found

    Hell yeah. You are right. Internet provider cuts-out few headers when phone is connected through "wap" apn. Everything is ok when I changed it do "internet" apn.

    Thank you for reply!

Similar Threads

  1. [moved] Why In header collection RHTTPResponse for field Set-Cookie is Cookie only?
    By anand_zain76 in forum Symbian Networking & Messaging (Closed)
    Replies: 5
    Last Post: 2011-03-31, 11:07
  2. A header not found when building on Carbide
    By nayana22 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2008-11-07, 07:50
  3. user set branch parameter in jain-sip via header?
    By vkunapuli in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2007-09-28, 17:13
  4. <---- cookie ----help ---->
    By cysnew in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-06-16, 04:53
  5. How do I set Content Type for the header?
    By gnewsom in forum Mobile Java General
    Replies: 0
    Last Post: 2005-05-31, 21:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×