does not seem to be getting all the cookie

View: New views
2 Messages — Rating Filter:   Alert me  

does not seem to be getting all the cookie

by Randy Paries-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,
in my client i am going to a page and then doing the following?:

            Cookie[] cookies = client.getState().getCookies();
            System.out.println("Present cookies: ");
            for (int i = 0; i < cookies.length; i++) {
                System.out.println(" - " + cookies[i].toExternalForm());
            }

All i get in the print out is
- session=8b45p8i4b0uk899iggk1kvht35

yet via firebug or fiddler when i go to this page via a browser
i see these
Cookie AWSUSER_ID=awsuser_id1256241083831r6937;
AWSSESSION_ID=awssession_id1256241083831r6937;
__utma=235052179.1675139821.1256241084.1256241084.1256242294.2;
__utmb=235052179.5.10.1256242294;
__utmz=235052179.1256241084.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)

Any suggestions on what i am doing wrong??

thanks
Randy

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@...
For additional commands, e-mail: httpclient-users-help@...


Re: does not seem to be getting all the cookie

by olegk :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Randy Paries wrote:

> Hello,
> in my client i am going to a page and then doing the following?:
>
>             Cookie[] cookies = client.getState().getCookies();
>             System.out.println("Present cookies: ");
>             for (int i = 0; i < cookies.length; i++) {
>                 System.out.println(" - " + cookies[i].toExternalForm());
>             }
>
> All i get in the print out is
> - session=8b45p8i4b0uk899iggk1kvht35
>
> yet via firebug or fiddler when i go to this page via a browser
> i see these
> Cookie AWSUSER_ID=awsuser_id1256241083831r6937;
> AWSSESSION_ID=awssession_id1256241083831r6937;
> __utma=235052179.1675139821.1256241084.1256241084.1256242294.2;
> __utmb=235052179.5.10.1256242294;
> __utmz=235052179.1256241084.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
>
> Any suggestions on what i am doing wrong??
>
> thanks
> Randy
>

Randy,

Most likely other cookies got rejected as invalid due to the selected
cookie policy. For details see:

http://hc.apache.org/httpclient-3.x/cookies.html

Oleg

PS: Also, consider upgrading to HttpClient 4.0, which can pick a more
lenient cookie policy automatically based on properties of the SetCookie
response headers.

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@...
For additional commands, e-mail: httpclient-users-help@...