On 11.12.2009 18:38, Kockert, Timo wrote:
We are using Cocoon and its EncodeUrlTransformer to do the session ID encoding:

<map:transformer logger="sitemap.transformer.encodeURL" name="encodeURL" 
pool-max="${encodeurl-
transformer.pool-max}" 
src="org.apache.cocoon.transformation.EncodeURLTransformer">
        
<include-name>.*/@href=|.*/@action=|frame/@src=|img/@src=|input/@src=</include-name>
        
<exclude-name>nonexistinghtmlelement/@nonexistingattribute=</exclude-name>
</map:transformer>

Hmm... I haven't used that transformer before. I'll have to take a look.
Something that seems obvious to me is that you probably want to add
something like this to the include-name:

|img/@src

This will (presumably) instruct the EncodeUrlTransformer to also
transform<img>  src attributes, too.

I did include that (see above) and it works (mostly) like expected.

As I wrote before this seems to be working fine for most devices.
They
either use cookies for all requests or all urls are beeing rewritten to
include the session ID.

The devices themselves don't do the URL rewriting: your server-side code
(or someone else's, in the case of Cocoon) does it for you.

Just to clarify: I know the EncodeUrlTransformer does the encoding for me. The 
problem seems to be that some devices do not send session ID cookies with image 
requests.

Hmmm, sounds a bit confusing. You'll need either working URL encoding or working cookies. You can support both at the same time, but either of it will suffice to implement session stickyness. mod_jk will look at the URL, searching for the ";jsessionid=..." as well as looking for a JSESSIONID cookie.

If you want to track, in which cases the browsers suport what, you can use the Apache access log. The URL is part of it, so you can see, whether the session id was part of the request URL, and by adding %{JSESSIONID}C to the LogFormat, you can log the JSESSIONID cookie send. By adding %{Set-Cookie}o you can log, whenever your server sets a new cookie.

You are aware of the fact, taht supporting session stickyness with mod_jk neeeds

- an individual jvmRoute set in server.xml for each node
- a loadbalancing worker defined for mod_jk, with one ajp member for each node, the name of the member equal to the jvmRoute (or at least the route attribute set to that).

And this is part of our problem: we cannot recreate the issue
locally
to debug it. We just see some 404s in the mod_jk logs from time to time.

Try just disabling cookies on your web browser and then checking the
pages. You ought to be able to figure out which images are failing by
just looking at your web server logs, and then searching for those image
references in your webapp. Browse to those pages with cookies disabled
and you should see broken images (or maybe not).

We already tried that. If we disable cookies on our web browsers (or the 
devices we tested), all urls (including image links) are beeing rewritten 
correctly by the Cocoon transformer.

You could also write a filter that sends an error when the URL doesn't
contain a jsessionid, just for this no-cookies test so you can reproduce
it and test it.

Interesting idea. I could modified the EncodeUrlTransformer to get some more 
debug information. Will try that on Monday.

Greetings,
Timo

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to