hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Speirs <wspe...@apache.org>
Subject Re: Inherit cookies from applet session
Date Thu, 16 Aug 2012 16:00:34 GMT
No, it shouldn't be too hard. I haven't done this (and don't have a
ton of time to play around with it right now... sorry). Hopefully
someone else on the mailing list will chime in.

Sorry...

Bill-

On Thu, Aug 16, 2012 at 9:30 AM, Austin, Carl
<Carl.Austin@baesystemsdetica.com> wrote:
> Thanks, I have seen the tutorial, and this does explain in detail
> setting cookies. However my applet makes all http calls in background
> threads so I have to work in an environment with many overlapping
> threads each of which could return a different jsessionid cookie. This
> is because the app server can change the session, JBOSS and WebLogic
> both change the jsessionid during normal access in some circumstances.
> If all of the threads are overlapping, how do I know which session id
> cookie to use for following requests if they all return in an
> unspecified order with more than 1 session id between them?
>
> Issues like this, and the seeming complexity of their solutions are
> leading me back to using HttpURLConnection as this is all managed so
> simply for me. I just have to sacrifice the extra levels of
> configuration that HttpClient would give me.
>
> Am I over complicating this or is it really this complicated to manage
> the session within such an applet with HttpClient?
>
> -----Original Message-----
> From: William Speirs [mailto:wspeirs@apache.org]
> Sent: 16 August 2012 14:20
> To: HttpClient User Discussion
> Subject: Re: Inherit cookies from applet session
>
> I've never setup the client to deal with cookies, but there is
> information in the state management section:
> http://hc.apache.org/httpcomponents-client-ga/tutorial/html/statemgmt.ht
> ml
>
> Bill-
>
> On Thu, Aug 16, 2012 at 4:40 AM, Austin, Carl
> <Carl.Austin@baesystemsdetica.com> wrote:
>> Hi,
>>
>>
>>
>> I am replacing some code in an applet, where HttpURLConnection was
> used,
>> with HttpClient (Version 4.2.1). All has gone well so far, however
>> unlike HttpURLConnection it seems that HttpClient doesn't inherit the
>> cookies from the session of the applet and as such the HttpClient
>> connection gets back a login page as I have the URL secured. I already
>> have an authenticated session as I authenticated to access the applet
> in
>> the first place. Is there a way to inherit this with HttpClient or do
> I
>> either need to re-authenticate or need to get the jsessionid (plus any
>> other cookies that may exist) from the applet's session and recreate
>> these cookies for the HttpClient request by hand? Ideally I would like
>> it to perform as URLConnection, and feel that perhaps I am missing
>> something.
>>
>>
>>
>> Many Thanks
>>
>>
>>
>> Carl
>>
>>
>>
>>
>> Please consider the environment before printing this email.
>>
>> This message should be regarded as confidential. If you have received
> this email in error please notify the sender and destroy it immediately.
>>
>> Statements of intent shall only become binding when confirmed in hard
> copy by an authorised signatory.
>>
>> The contents of this email may relate to dealings with other companies
> under the control of BAE Systems plc details of which can be found at
> http://www.baesystems.com/Businesses/index.htm.
>>
>> Detica Limited is a BAE Systems company trading as BAE Systems Detica.
>> Detica Limited is registered in England and Wales under No: 1337451.
>> Registered office: Surrey Research Park, Guildford, Surrey, GU2 7YP,
> England.
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
> Please consider the environment before printing this email.
>
> This message should be regarded as confidential. If you have received this email in error
please notify the sender and destroy it immediately.
>
> Statements of intent shall only become binding when confirmed in hard copy by an authorised
signatory.
>
> The contents of this email may relate to dealings with other companies under the control
of BAE Systems plc details of which can be found at http://www.baesystems.com/Businesses/index.htm.
>
> Detica Limited is a BAE Systems company trading as BAE Systems Detica.
> Detica Limited is registered in England and Wales under No: 1337451.
> Registered office: Surrey Research Park, Guildford, Surrey, GU2 7YP, England.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>

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


Mime
View raw message