Bug 34749 - jsessionid dropped on trailing slash (/) redirect
jsessionid dropped on trailing slash (/) redirect
Status: RESOLVED FIXED
Product: Tomcat 5
Classification: Unclassified
Component: Connector:Coyote
5.0.30
Other other
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2005-05-05 05:28 UTC by J. David Beutel
Modified: 2005-09-22 11:20 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description J. David Beutel 2005-05-05 05:28:38 UTC
When CoyoteAdapter forces a redirect from, e.g., /someDir to /someDir/ it omits
the jsessionid from the URL.  This prevents Filters from using the session after
the redirect.

To reproduce:
1. Turn off cookies by adding <DefaultContext cookies="false"/> to server.xml.
2. Start Tomcat and browse to the session example:
http://localhost:8080/servlets-examples/servlet/SessionExample
3. Click on the "URL encoded" link, e.g.:
http://localhost:8080/servlets-examples/servlet/SessionExample;jsessionid=B191701A64C8AA13956E21B3C6D801AA?dataname=foo&datavalue=bar
4. Edit the URL changing "servlet/SessionExample" to "images/" and press Enter:
http://localhost:8080/servlets-examples/images/;jsessionid=B191701A64C8AA13956E21B3C6D801AA?dataname=foo&datavalue=bar
5. Edit the URL deleting the "/" before the ";" and press Enter:
http://localhost:8080/servlets-examples/images;jsessionid=B191701A64C8AA13956E21B3C6D801AA?dataname=foo&datavalue=bar
6. Observe that the redirected URL is missing the jsessionid:
http://localhost:8080/servlets-examples/images/?dataname=foo&datavalue=bar

(This bug can also be reproduced without the query parameters.)
Comment 1 Remy Maucherat 2005-09-22 19:20:56 UTC
I have fixed this in the 5.5.x branch, to be integrated in 5.5.12.