Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 75514 invoked from network); 4 Jan 2007 05:56:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Jan 2007 05:56:52 -0000 Received: (qmail 39788 invoked by uid 500); 4 Jan 2007 05:56:45 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 39621 invoked by uid 500); 4 Jan 2007 05:56:44 -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 39610 invoked by uid 99); 4 Jan 2007 05:56:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jan 2007 21:56:44 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [192.61.61.104] (HELO usea-naimss2.unisys.com) (192.61.61.104) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Jan 2007 21:56:33 -0800 Received: from usea-nagw2.na.uis.unisys.com ([129.224.72.18]) by usea-naimss2 with InterScan Message Security Suite; Wed, 03 Jan 2007 23:56:05 -0600 Received: from usea-nagw2.na.uis.unisys.com ([129.224.72.53]) by usea-nagw2.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 3 Jan 2007 23:56:05 -0600 Received: from USRV-EXCH4.na.uis.unisys.com ([192.61.245.232]) by usea-nagw2.na.uis.unisys.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 3 Jan 2007 23:56:05 -0600 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: URL rewriting For Session Tracking Date: Wed, 3 Jan 2007 23:56:03 -0600 Message-ID: In-Reply-To: <00c801c72fbf$31630360$3c34de0a@shahpoor> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: URL rewriting For Session Tracking Thread-Index: Accvv1UahyEySNNcRuqewV9Xhq1p7gAAjkog From: "Caldarale, Charles R" To: "Tomcat Users List" X-OriginalArrivalTime: 04 Jan 2007 05:56:05.0349 (UTC) FILETIME=[05AAC950:01C72FC5] X-Virus-Checked: Checked by ClamAV on apache.org > From: jobs@ultratechpartners.com [mailto:jobs@ultratechpartners.com]=20 > Subject: Re: URL rewriting For Session Tracking >=20 > Basically I have a webapp and I want to have a session > for each user that connects to my server (just the usual > servlet session that is created with jsessionid). Do I > have to wrap every link that I have in my webapp with an=20 > Httpservletresponse.encodeURL()? No. As I recall, Tomcat will not create a session automatically unless it's absolutely necessary (e.g., tracking authenticated users) or the application requests it. I'm not aware of any config parameter that will force creation of sessions for all clients, but all you should have to do is put the following somewhere in the request processing path of each servlet: request.getSession(true); This doesn't need to go into your servlet or JSP code - you can write a simple filter class that does nothing but run the above code to force the creation of a session if one doesn't already exist. The filter mapping can go into conf/web.xml so it will apply to all apps deployed within your Tomcat instance, or in each appropriate webapp's web.xml file. Note that per the servlet spec, Tomcat will use cookies not URL rewriting for session tracking; it will fall back to URL rewriting if the client refuses cookies. You can also disable use of cookies by setting cookies=3D"false" in your elements (or the global conf/context.xml file). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org