Return-Path: Delivered-To: apmail-jakarta-httpclient-dev-archive@www.apache.org Received: (qmail 25489 invoked from network); 26 Aug 2005 15:52:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 Aug 2005 15:52:46 -0000 Received: (qmail 41957 invoked by uid 500); 26 Aug 2005 15:52:45 -0000 Delivered-To: apmail-jakarta-httpclient-dev-archive@jakarta.apache.org Received: (qmail 41931 invoked by uid 500); 26 Aug 2005 15:52:45 -0000 Mailing-List: contact httpclient-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "HttpClient Project" Reply-To: "HttpClient Project" Delivered-To: mailing list httpclient-dev@jakarta.apache.org Received: (qmail 41915 invoked by uid 99); 26 Aug 2005 15:52:44 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2005 08:52:44 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of odi@odi.ch designates 81.7.230.227 as permitted sender) Received: from [81.7.230.227] (HELO LOW2000EXCHANGE.logobject.ch) (81.7.230.227) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Aug 2005 08:53:00 -0700 Received: from [10.11.1.211] ([10.11.1.211]) by LOW2000EXCHANGE.logobject.ch with Microsoft SMTPSVC(5.0.2195.6713); Fri, 26 Aug 2005 17:29:23 +0200 Message-ID: <430F3ACD.3010702@odi.ch> Date: Fri, 26 Aug 2005 17:52:45 +0200 From: =?ISO-8859-1?Q?Ortwin_Gl=FCck?= User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: HttpClient Project Subject: Re: session not closed tomcat's manager References: <001701c5aa52$5e2461d0$7eda01a4@rdb.aphopparis.fr> <430F358F.2010302@odi.ch> <002101c5aa55$56ea87c0$7eda01a4@rdb.aphopparis.fr> In-Reply-To: <002101c5aa55$56ea87c0$7eda01a4@rdb.aphopparis.fr> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 26 Aug 2005 15:29:23.0221 (UTC) FILETIME=[EF818450:01C5AA52] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Eric, client.getHttpConnectionManager().getConnection(client.getHostConfiguration( > )).setConnectionTimeout(1); This line pops a new connection from the connection manager. Don't do that! You will disrupt connection management like this. A new session in Tomcat is openend as soon as a new connection is established to the server without a valid session cookie. This session will remain until you explicitly invalidate it or it times out. The session will survive a closed connection of course. Once again: You can not control session lifecycle from the client. Connection timeout has nothing to do with session timeout. Ortwin Gl�ck Eric Portalez wrote: > Thank you. > > I call HttpMethod.releaseConnection, indeed. > > You perfectly right about my intention : destroy the opened session on my > server. > My problem is that I have to fix the timeout at 2 hours (I can't explain why > here, it would be too long). > But, in some cases, I don't want my session exist too long. > > The line > client.getHttpConnectionManager().getConnection(client.getHostConfiguration( > )).setConnectionTimeout(1); > is not taken into account, maybe because I have to call it before the call > of the executeMethod() ? > > I will do some tests. > > If you have any others suggestions, I would appreciate them. > > Thanks. > > Eric Portalez. > > ----- Original Message ----- > From: "Ortwin Gl�ck" > To: "HttpClient Project" > Sent: Friday, August 26, 2005 5:30 PM > Subject: Re: session not closed tomcat's manager > > > Eric, > > this code looks funny - and is completely useless. Remove it. > All you have to do is call HttpMethod.releaseConnection. > > You are trying to destroy a server-side session from the client side. > This is simply impossible. Your *webapplication* has to destroy the > session with a call to HttpSession.invalidate(). Or you can simply wait > until it expires. Default timeout is something like 30 minutes or so. > Normally a session is destroyed upon "logout" from the webapp. How that > happens is not standardized and depends completely on the concrete > implementation. > > Ortwin Gl�ck > > Eric Portalez wrote: > >>Hello, >> >>I'm trying to terminate properly my session, but I don't manage. >> >>Here my code : >> >>public void closeSession() throws IOException{ >> if(client != null){ >> > > client.getHttpConnectionManager().getConnection(client.getHostConfiguration( > )).setConnectionTimeout(1); > > client.getHttpConnectionManager().releaseConnection(client.getHttpConnection > Manager().getConnection(client.getHostConfiguration())); > > client.getHttpConnectionManager().getConnection(client.getHostConfiguration( > )).close(); > >> client.setConnectionTimeout(1); >> client = null; >> } >>} >> >> >>I've tried differents combinations without any success. My manager in > > tomcat always shows me that the session is opende. > >>I precise that my session disapear correctly at the end of the timeout. >> >> >>Any ideas ? >> >>Thanks. >> >> >>Eric Portalez >> >> > > -- [web] http://www.odi.ch/ [blog] http://www.odi.ch/weblog/ [pgp] key 0x81CF3416 finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416 --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org