Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mod_rewrite is screwing up my session

Status
Not open for further replies.

carpeliam

Programmer
Mar 17, 2000
990
US
I'm using Apache Tomcat and mod_webapp in addition to Apache HTTPD. To get rid of the extra space at the end of the URL, I'm using mod_rewrite. (I'm also using Apache Cocoon with Tomcat.. but that's not really an issue.)

So let's say that with a directory of localhost/cocoon/cms/, I want localhost/cms/. (I'm using the PT "pass-through" flag so it's invisible to the user.)

Code:
RewriteEngine On
RewriteLog "E:/rewrite.log"
RewriteLogLevel 3
RewriteRule /cms/(.*) /cocoon/cms/$1 [PT]

This works, but the problem is that Tomcat sessions aren't working when I use mod_rewrite.

Here's a list of the parameters supplied when I don't use mod_rewrite:

Code:
PARAM: 'cookie' VALUES: '[JSESSIONID=A897E11152D430961782D5C9D9E67211; CMSUSER=mMsjah1coqlTGONdauaj1HrXi%2Fi2nT0lSZBixdwP%2BwQ%3D]'
PARAM: 'connection' VALUES: '[Keep-Alive]'
PARAM: 'accept-encoding' VALUES: '[gzip, deflate]'
PARAM: 'referer' VALUES: '[[URL unfurl="true"]http://localhost/cocoon/cms/info/mission.html[/URL]]'
PARAM: 'accept' VALUES: '[image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*]'
PARAM: 'accept-language' VALUES: '[en-us]'
PARAM: 'user-agent' VALUES: '[Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)]'
PARAM: 'host' VALUES: '[localhost]'

And here's what happens when I use mod_rewrite:
Code:
PARAM: 'cookie' VALUES: '[CMSUSER=mMsjah1coqlTGONdauaj1HrXi%2Fi2nT0lSZBixdwP%2BwQ%3D]'
PARAM: 'connection' VALUES: '[Keep-Alive]'
PARAM: 'accept-encoding' VALUES: '[gzip, deflate]'
PARAM: 'referer' VALUES: '[[URL unfurl="true"]http://localhost/cms/news/news_story_1.html[/URL]]'
PARAM: 'accept' VALUES: '[*/*]'
PARAM: 'accept-language' VALUES: '[en-us]'
PARAM: 'user-agent' VALUES: '[Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Q312461)]'
PARAM: 'host' VALUES: '[localhost]'

As you can tell, there's no JSESSIONID when I use mod_rewrite.. also, the 'accept' parameter is different.

If anybody can help me, I'd greatly appreciate it. Thanks:) Liam Morley
lmorley@gdc.wpi.edu
"light the deep, and bring silence to the world.
light the world, and bring depth to the silence."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top