Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 841D210B25 for ; Fri, 8 Nov 2013 21:09:10 +0000 (UTC) Received: (qmail 97718 invoked by uid 500); 8 Nov 2013 21:09:07 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 97663 invoked by uid 500); 8 Nov 2013 21:09:07 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 97654 invoked by uid 99); 8 Nov 2013 21:09:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 21:09:07 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [76.96.62.40] (HELO qmta04.westchester.pa.mail.comcast.net) (76.96.62.40) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Nov 2013 21:09:02 +0000 Received: from omta04.westchester.pa.mail.comcast.net ([76.96.62.35]) by qmta04.westchester.pa.mail.comcast.net with comcast id n62F1m0080ldTLk5498gpX; Fri, 08 Nov 2013 21:08:40 +0000 Received: from Christophers-MacBook-Pro.local ([68.55.8.89]) by omta04.westchester.pa.mail.comcast.net with comcast id n98g1m00P1vFKdg0198gaC; Fri, 08 Nov 2013 21:08:40 +0000 Message-ID: <527D52DF.4020004@christopherschultz.net> Date: Fri, 08 Nov 2013 16:08:47 -0500 From: Christopher Schultz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: Session init problem since moving to new server/tomcat References: <1383922260.94954.ezmlm@tomcat.apache.org> <4e5c153c2962bdc3b36afd48cc0da603@gleichklang.de> <527D01CA.9080707@christopherschultz.net> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1383944920; bh=47enAegtnZbOYJ2YGb+ORNWsOQ+l5nr0d8/OOF9QUSw=; h=Received:Received:Message-ID:Date:From:MIME-Version:To:Subject: Content-Type; b=MmeU0EhgWp9UIZJI/4OZyeQK0FzqI+856mTdHki5zCSOLWOm2P7dNb8KbBLTrp9D8 xXVFQ/uiNOoxNQxYDcld5EpWfTTYl3QPtJOwHgs/06HeeUlZMiGiISK6GugqhlcAWT yB0wAnZq8ikUk6Fah0hwX1qIbXQwkBoeUuMMmukFWGBEgT+5urIBnVArdrdolWORYg BicjDOD7b5tnT7HF4NemKmPiuYC7tfwnUm6RSArleg1V+7yvqKQAZMgqSiMZAJwMD1 dD97abCqX8YNMoIG4McQZt1tn2I1vXOXQHjCFuo7upulRG1MQ5k78+vF5kwd57e5VP ps9D9tYZg5bzg== X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Martin, On 11/8/13, 11:40 AM, Martin wrote: > Thank you Christopher for your in depth annotations. We just > downgraded from v6.0.34 to .20 and the problem has vanished. We > obviously have some changes to do before we can upgrade to v7 as > far as the session handling is concerned. Your post will help us > along the way. Thanks again. I really suspect the session id switching is the problem. Check the changelog between .20 and .34 for things that smell like they might be related to your issue. You should really re-upgrade back to 6.0.latest as soon as you can: there are good performance and important security updates included in those later versions. - -chris > Am 2013-11-08 16:22, schrieb Christopher Schultz: Martin, > > On 11/8/13, 9:59 AM, Martin wrote: >>>> Recently we moved our application from an old ubuntu to a >>>> newer centos box. We upgraded our JAVA version, tomcat (from >>>> v5 to latest v6) and basically all server components. > > I would highly recommend that you upgrade directly to 7.0.x... > moving from Tomcat 6 to Tomcat 7 is much easier than the transition > from 5.0 to 6.0. Make the investment, now. Tomcat 8 is just around > the corner which means that Tomcat 6's days are numbered (though it > may still have 1000 days left in its lifetime). > >>>> Local tests of our application showed no problems with these >>>> newer versions, in fact it has been developed with these >>>> since quite some time. >>>> >>>> But now we seem to have a problem with our session >>>> management/creation, however only on the new live server, >>>> not locally. >>>> >>>> Whenever a user visits a page (the login page) for the very >>>> first time (no JSESSIONID-Cookie), the first login form >>>> submit does not work. Our live application obviously >>>> encounters some kind of unexpected stuff. The followup form >>>> submit works as expected. The JSESSIONID is created on the >>>> first page load btw. > > What does your login
look like? Often, users forget to > encode the session id in the URL for the form like this: > > > > It would be better to do this: > > " /> > > That way, Tomcat will get the session identifier whether cookies > are in use or not. > >>>> The person who wrote this part of our application has gone >>>> AWOL and locally we cannot reproduce this. >>>> >>>> Do you guys have any idea what could be responsible for this? >>>> I obviously copied all the tomcat settings from the older >>>> version and I cannot find anything worthy in the logs. > > Some things have changed from Tomcat 5 to Tomcat 6 and later, > especially with session-handling during login. For example, Tomcat > now switches session-ids after a successful login in order to > protect against session-fixation attacks. Also, Tomcat now requires > (though I'm not sure if this is different from the Tomcat 5 days) a > session to be in place in order to show the login screen because it > needs to store the original request somewhere for a > post-authentication redirect. > > Are you using the "standard" spec-defined login process: > > 1. User requests a protected page 2. Container challenges user for > credentials 3. User provides valid credentials 4. Container sends > the user to the originally-requested resource > > ? > > Or, are you using what I call a drive-by login where you just have > the login page showing in index.jsp or whatever with a login > button? This last one won't work the way you expect it to work, > because the spec (stupidly, IMO) didn't include a standard way for > containers to handle "unsolicited" logins. > > These days (Servlet 3.0, which means Tomcat 7 and later), you can > write your own login-handler for these drive-by logins. > > (Actually, looking at the documentation for > HttpServletRequest.login, it seems like this might not actually > work (or if it does, it might violate the spec) since it says that > getAuthType must return null in order for login() to be successful. > That sounds to me like either the container is in total control, or > the webapp is in total control. Hmm.) > > -chris >> >> --------------------------------------------------------------------- >> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org > > >  > > > http://www.gleichklang-mail.de: Der Email-Zugang für ökologisch > und sozial denkende Menschen! > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (Darwin) Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJSfVLaAAoJEBzwKT+lPKRYK7UP/0MUSJJvTiYnJ1RjzehRGSmG oky4yx6kHcFJ/eJnl3MwdvZpmiI2+AZ6i9cwcHy9YkLMAwbegdnYMPAnmqMQrqDa YybfcA877nbseqDrQnRDq2CM4E6KZU9zHypimuswBImHUF9dsqVrdotFx0iLI39y JpAk1xnvM7GFxfqoJXomon0S9u0uxosHrB2soppyigMxyOlZhqsfLNMxoIyyb2C3 OrSRM0vVfM5oPfRfwYbinjhmw0TMxiQybZJxDFqbFO189GWomazmB1ygOTCmHIOe i1yDw5GYJXcuNbBAfXnKWZFN6Tx7V0tK+4TQ1WR7U0w8amP9FYpaEL2a8o1daRLW 7YHMUqQDUs4hLcaF1BqeEq+cNbmIgCxTvDy3nY4qniGiKFWWjYz6HkIIIsLxP2Na 7UWxDVxlgaZlHF+ekQEV1gOyStNhUUZF9sv0fwhEHDnDbvgkRfCL7A77cJrCiEZl qfVOor7iqhrOn7SnF4gq+5C1EPdPS96bWB8qrjyJ8u8W/DhT+FkB786rUPni6Sfu KesR0KznjMSWmlNYQWMZwpOrZM0OPLG8//GFj0a8rHoiyvsygYLQwbsSYBIosX+J nh04O07uwm7+/WdhaGtiC5dAihP3eLquevynAIl4QlqOH+RxDJuo12oSiPujq5I7 fjxFE3fNsElZri5fNSBy =HGIu -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org