Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 25189 invoked from network); 2 Dec 2004 15:19:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Dec 2004 15:19:22 -0000 Received: (qmail 59488 invoked by uid 500); 2 Dec 2004 15:17:27 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 59252 invoked by uid 500); 2 Dec 2004 15:17:23 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 59196 invoked by uid 99); 2 Dec 2004 15:17:19 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from friction.omegabyte.com (HELO friction.omegabyte.com) (66.194.160.8) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 02 Dec 2004 07:17:10 -0800 Received: from omegabyte.com ([127.0.0.1]) by friction.omegabyte.com (Sun ONE Messaging Server 6.0 Patch 1 (built Jan 28 2004)) with ESMTP id <0I8300A98P96RG10@friction.omegabyte.com> for tomcat-user@jakarta.apache.org; Thu, 02 Dec 2004 09:19:54 -0600 (CST) Received: from [24.227.160.142] by friction.omegabyte.com (mshttpd); Thu, 02 Dec 2004 09:19:54 -0600 Date: Thu, 02 Dec 2004 09:19:54 -0600 From: Al Gidden Subject: Re: getting desperate here :) To: =?iso-8859-1?Q?Tomcat=A0Users=A0List=A0?= , =?iso-8859-1?Q?=A0Alex=A0Korneyev=A0?= Message-id: <6922f2611b19.41aede3a@omegabyte.com> MIME-version: 1.0 X-Mailer: Sun ONE Messenger Express 6.0 Patch 1 (built Jan 28 2004) Content-type: text/plain; charset=us-ascii Content-language: en Content-transfer-encoding: 7BIT Content-disposition: inline X-Accept-Language: en Priority: normal X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Perhaps I am missing something here, so my apologies if this comes off a bit green. Looking at the code it would appear that the FOR loop looks for the existing JSESSIONID cookie value. But it appears that whether it is found or not you are using .addCookie. I would think you would use [something like] .setValue in the case you find the cookie in the FOR loop. You want to effectively replace the current JSESSIONID with a new one, but .addCookie will add a new cookie, even if you expire the existing one. I mention this because I bet that Mozilla using the last JSESSIONID it finds (which makes it work by coincidence), whereas IE just seems to suck it all up as one JSESSIONID. HIH, Al G ----- Original Message ----- From: Alex Korneyev Date: Thursday, December 2, 2004 9:05 am Subject: getting desperate here :) > Hello all, > > i have sent this one before, but i am hoping someone else has > had this particular problem. > __ > > > i am hoping someone has seen the following behavior. > > > TomcatA sends a redirect to TomcatB > > on the backend, I can see that TomcatB receives a JSESSIONID that was > originally assigned to it by TomcatA; > > i.e. cookie = JSESSIONID=6EF95FA9AA98E608C555E28875F57054; > > > I rewrite reset the jsession id ( see the code bellow ), but > > > on the next request i see this: > > cookie = JSESSIONID=6EF95FA9AA98E608C555E28875F57054; > JSESSIONID=2251830F6F64DEFC974C19C79F1EABAB > for some reason using Mozilla works, but I.E. is the one that passes > 2 JSESSIONID variables. Thoughts? > > if (cookies != null && cookies.length > 0) > { > int len = cookies.length; > for (int i = 0; i < len; i++) > { > if > (cookies[i].getName().equalsIgnoreCase("jsessionid")) > { > cookies[i].setMaxAge(-1); > cookies[i].setPath("/"); > _LOGGER.debug("COOKIE > VALUE " + cookies[i].getValue() ); > _LOGGER.debug("session id: > " + request.getSession().getId() ); > _LOGGER.debug(" comp" + ( > request.getSession().getId().equals(cookies[i].getValue()))); > if ( > request.getSession().getId().equals(cookies[i].getValue())) > { > > _LOGGER.debug("equal"); > response.addCookie(cookies[i]); > } > else > { > _LOGGER.debug("not > equal"); Cookie > sessionCookie = new Cookie("JSESSIONID", > request.getSession().getId()); > > response.addCookie(sessionCookie); > } > foundCookie = true; > _LOGGER.debug("updated > session cookie"); > > } > } > } > > > > > > > > > ------------------------------------------------------------------- > -- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org