hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Problem with HttpClient and cookies...
Date Thu, 06 Dec 2007 17:29:13 GMT
On 06/12/2007, Joseph Jupin <joe.jupin@fe77.com> wrote:
> Oh, the dreaded matching Cookies when calling a post to a site that's
> looking for them.  Unfortunately, I've fallen into this trap and need
> a little help getting out - maybe with a few pointers somewhere,
> whatever.
>
> Okay, first off - yes, I've read the documentation for newbies, the
> quick start and have even dug into the src code for HttpClient - hell,
> I even overloaded a few of the classes (CookieSpec and Cookie) to get
> my call to recognize the cookies being set.  It's all been for naught
> - sort of...
>
> Here's the gist of the problem:
>
> Cookies are not enabled on your browser. Please adjust this in your
> security preferences before continuing
>
> yep - that's what I get back no matter what I do now.  yes, I make
> sure the cookies look like a valid session from a browser.  I've gone
> into firefox and pulled out all the cookies made for this domain - and
> mimic'd each and every one.

You can't normally re-use cookies from another session.

>
> Yes, I've tried emulating different Browsers.  My current one is set
> to Mozilla 5.0.
>
> I've gotten rid of the dread httpOnly tag by re-writing the
> CookieSpecBase class to ignore this parameter.  From what I can tell,
> the site only sends it - it never tries to recover it - and the cookie
> itself doesn't even seem to store it as an attribute of the session.
>
> So, has anyone else seen this message - or could maybe direct me to
> possible solutions?

Are you sure that the application is logging in correctly?

> The next thing I'm going to try is to attach a mechanism to watch how
> the cookie is formatted coming down and installed on a browser and see
> if it differs much from mine - and - vice versa - how the cookie looks
> going up and seeing if I match it.

HttpClient supports logging:

http://jakarta.apache.org/httpcomponents/httpclient-3.x/logging.html

Use the "best for debugging" settings; this will include cookies.

> many, many thanx for reading my partial rant/ plea for help!
>
> ;-)
>
> peace.  JOe...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Mime
View raw message