Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 43852 invoked from network); 5 Mar 2008 19:31:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Mar 2008 19:31:58 -0000 Received: (qmail 95183 invoked by uid 500); 5 Mar 2008 19:31:53 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 95165 invoked by uid 500); 5 Mar 2008 19:31:53 -0000 Mailing-List: contact httpclient-users-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpClient User Discussion" Delivered-To: mailing list httpclient-users@hc.apache.org Received: (qmail 95156 invoked by uid 99); 5 Mar 2008 19:31:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Mar 2008 11:31:53 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=MISSING_MID,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [62.81.187.139] (HELO mail.interd4u.com) (62.81.187.139) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Mar 2008 19:31:17 +0000 Received: (qmail 12072 invoked by uid 512); 5 Mar 2008 19:31:21 -0000 Received: from 80.25.178.93 by jupiter (envelope-from , uid 508) with qmail-scanner-1.25st (clamdscan: 0.87/1149. spamassassin: 3.1.0. Clear:RC:1(80.25.178.93):. Processed in 0.060317 secs); 05 Mar 2008 19:31:21 -0000 Received: from 93.red-80-25-178.staticip.rima-tde.net (HELO Portatil04) (joan.balaguero@grupoventus.com@80.25.178.93) by jupiter with ESMTPA; 5 Mar 2008 19:31:21 -0000 From: =?iso-8859-1?Q?Joan_Balaguer=F3?= To: "'HttpClient User Discussion'" Subject: RE: Question About Cookies Date: Wed, 5 Mar 2008 20:30:55 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <47CEE898.5030706@dubioso.net> Thread-Index: Ach+7+HD10uun3s9S6OwS1A79zgspgABw/fg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Qmail-Scanner-Message-ID: <120474548192212065@jupiter> X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <20080305193126.67F0B724A00@athena.apache.org> Hello, Thanks for your response. Now I know how to send a cookie just related to one thread. But how to receive a cookie from my remote server? I was using : Cookie[] auxCookies =3D objHttp.getState().getCookies(); Now I know this is incorrect. I suppose that I must get cookies from the Post method. But how? Should I use the "method.getResponseHeader("Set-Cookie")? Or there is another way? Thanks, Joan. =20 -----Mensaje original----- De: Roland Weber [mailto:ossfwot@dubioso.net]=20 Enviado el: mi=E9rcoles, 05 de marzo de 2008 19:38 Para: HttpClient User Discussion Asunto: Re: Question About Cookies Hello Joan, there is no need to shout. > The question is: doing this, am I setting this cookie for all threads = or > just for the current thread that is executing this code? For all threads. > Obviously, I want > to set this cookie just for the current thread, not for all. Is this > correct? And if not, how should I do it? You should have a separate HttpState object for each thread instead of using the default HttpState object for all of them: http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient= /Ht tpClient.html#executeMethod(org.apache.commons.httpclient.HostConfigurati= on, %20org.apache.commons.httpclient.HttpMethod,%20org.apache.commons.httpcli= ent .HttpState) > And the following question is: this request is sent to another = servlet, that > reads it. But if I examine the HttpServletRequest, I always get null = for > cookies attribute. It=92s like httpclient is not including the cookie = in the > request I=92m sending to the remote servlet. Check the domain and path attributes of your cookie. Enable wire logging to see wether the cookie is sent or not. http://hc.apache.org/httpclient-3.x/logging.html hope that helps, Roland --------------------------------------------------------------------- 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