I am not sure if this is a new bug (i have used tomcat4 for now and the .24 release is my first try to move to tomcat5). Tomcat (now) sets two cookies - one for the root-context and one for the application context - say (/opsjs). Now on every request two cookies are sent to tomcat - one session-id for the root context and one for the application-context. But it looks like tomcat cant handle this case - maybe only the first cookie is processed and this do not match to the cookie-list for the application-context (just an idea) - so a new session is started and a new cookie sent to the browser. I have had to disable the cookies on the root context. <Context path="" docBase="ROOT" debug="0" cookies="false"/> Then the application works like expected - only one cookie is sent. The definition of the application context is: <Context path="/opsjs" docBase="/u/opsj" crossContext="false" debug="0" reloadable="false" trusted="false" > ... Since another user experienced the same problem i decided to enter this (new) behaviour as critical.
This is now fixed.
Index: CoyoteAdapter.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/coyote/tomcat5/CoyoteAdapter.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- CoyoteAdapter.java 28 Apr 2004 22:05:10 -0000 1.25 +++ CoyoteAdapter.java 14 May 2004 11:00:25 -0000 1.26 @@ -295,6 +295,9 @@ return false; } + // Parse session Id + parseSessionCookiesId(req, request); + return true; } @@ -352,6 +355,14 @@ request.setRequestedSessionId(null); request.setRequestedSessionURL(false); } + + } + + + /** + * Parse session id in URL. + */ + protected void parseSessionCookiesId(Request req, CoyoteRequest request) { // Parse session id from cookies Cookies serverCookies = req.getCookies();
Created attachment 11548 [details] Extract the package in the Tomcat installation folder
Created attachment 11549 [details] Extract the package in the Tomcat installation folder (zip format)