Return-Path: Delivered-To: apmail-hc-httpclient-users-archive@www.apache.org Received: (qmail 68471 invoked from network); 22 Feb 2009 16:14:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2009 16:14:57 -0000 Received: (qmail 76068 invoked by uid 500); 22 Feb 2009 16:14:56 -0000 Delivered-To: apmail-hc-httpclient-users-archive@hc.apache.org Received: (qmail 76040 invoked by uid 500); 22 Feb 2009 16:14:56 -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 76029 invoked by uid 99); 22 Feb 2009 16:14:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Feb 2009 08:14:56 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [217.150.250.44] (HELO ok2consulting.nine.ch) (217.150.250.44) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Feb 2009 16:14:48 +0000 Received: by ok2consulting.nine.ch (Postfix, from userid 1002) id CDB7D19856D; Sun, 22 Feb 2009 17:14:26 +0100 (CET) Received: from [192.168.1.100] (84-75-98-56.dclient.hispeed.ch [84.75.98.56]) by ok2consulting.nine.ch (Postfix) with ESMTP id 4DBE819856B for ; Sun, 22 Feb 2009 17:14:26 +0100 (CET) Message-ID: <49A179CE.3040706@apache.org> Date: Sun, 22 Feb 2009 17:14:06 +0100 From: Oleg Kalnichevski User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: HttpClient User Discussion Subject: Re: How do you set cookies on initial post in HttpClient? References: <88881cea0902201350s39343e53i2251a90f706e31d3@mail.gmail.com> <88881cea0902201442w2bdee19dp1f7c5aafae5a5e85@mail.gmail.com> In-Reply-To: <88881cea0902201442w2bdee19dp1f7c5aafae5a5e85@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on ok2consulting.nine.ch X-Spam-Level: X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.3 Scott Mueller wrote: > By the way, this example code of setting cookies in HttpClient doesn't work > either: > http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientCustomContext.java > > I copied the code there like this: > DefaultHttpClient client = new DefaultHttpClient(); > CookieStore cookieStore = new BasicCookieStore(); > cookieStore.addCookie(new BasicClientCookie("JSESSIONID", > getParameter("session"))); > HttpContext context = new BasicHttpContext(); > context.setAttribute(ClientContext.COOKIE_STORE, cookieStore); > client.execute(post, context); > > Again, no cookies are specified on the http post. All I want to do is > attach the applet to the same session as the browser. Is there a better way > to do this? Are cookies functional in HttpClient beta 2? > Yes, they are. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org For additional commands, e-mail: httpclient-users-help@hc.apache.org