You need to look into the cookie domain and cookie path of the session cookies 
returned to the browser. It may be that these values are such that the browser 
does not send the cookie with the following request.

To look at these values, use LiveHTTPHeaders or HTTPWatch (Firefox and IE 
resp.) to inspect the Set-Cookie headers.

-ascs

-----Original Message-----
From: Pete Lamborne [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 06, 2006 10:00 PM
To: users@httpd.apache.org
Subject: [EMAIL PROTECTED] Losing session -- mod_rewrite

Check this out:

I have two rewrite rules, basically going to the same place (same context):

RewriteRule ^/pub/?(.*)      ajp://dev3:8009/pub/$1 [QSA,P,L]
RewriteRule ^/pub-test/?(.*) ajp://dev3:8009/pub/$1 [P,QSA,L]

The 1st one maintains session (tomcat backend), the 2nd does not, generating a 
new session with each request.

So if the rewrite rule does not mask the Tomcat context, everything is good, 
but if it does session gets lost.

The cookies that Tomcat is setting all say /pub, which is what I want.

Apologies if this is one for the tomcat-user list, but I figure this is likely 
a problem folks from this list can help me solve.

I messed around with [PT] and an Alias rule, to no avail.  Hoping this one is 
easy and obvious for someone.

Rewrite log follows, in case it helps at all.
pete

10.1.10.82 - - [06/Jan/2006:13:56:49 --0700] 
[dev2/sid#862bac0][rid#86e3060/initial] (2) init rewrite engine with requested 
uri /pub-test/test1.jsp
10.1.10.82 - - [06/Jan/2006:13:56:49 --0700] 
[dev2/sid#862bac0][rid#86e3060/initial] (3) applying pattern '^/servlets(.*)' 
to uri '/pub-test/test1.jsp'
10.1.10.82 - - [06/Jan/2006:13:56:49 --0700] 
[dev2/sid#862bac0][rid#86e3060/initial] (3) applying pattern '^/video/?(.*)' to 
uri '/pub-test/test1.jsp'
10.1.10.82 - - [06/Jan/2006:13:56:49 --0700] 
[dev2/sid#862bac0][rid#86e3060/initial] (3) applying pattern '^/pub-test/?(.*)' 
to uri '/pub-test/test1.jsp'
10.1.10.82 - - [06/Jan/2006:13:56:49 --0700] 
[dev2/sid#862bac0][rid#86e3060/initial] (2) rewrite '/pub-test/test1.jsp' -> 
'ajp://dev3:8009/pub/test1.jsp'
10.1.10.82 - - [06/Jan/2006:13:56:49 --0700] 
[dev2/sid#862bac0][rid#86e3060/initial] (2) forcing proxy-throughput with 
ajp://dev3:8009/pub/test1.jsp
10.1.10.82 - - [06/Jan/2006:13:56:49 --0700] 
[dev2/sid#862bac0][rid#86e3060/initial] (1) go-ahead with proxy request 
proxy:ajp://dev3:8009/pub/test1.jsp [OK]


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to