Hello all,

I'm trying to write a uri-based session-handling system that uses a
PerlTransHandler
to pull out the Session ID, validate it and store it into a Request Note.
(Much like
the example in the Eagle book)  Rather than customizing every
ContentHandler, however,
it uses a subclass of Apache::OutputChain to insert the SessionID into all
the self-referencing
URLs in text/html output files.  The idea is that it can then work for
static HTML files
in addition to custom dynamic output.

This works fine under most circumstances, but unforunately, when the URI
requests is for
a directory, there are subrequests to find the 'index.html' file and then
what looks like
an internal redirect to that file.  As a result, my TransHandler is getting
called several
times, each one using a new Session ID and doing at least one database
query.  In other words,
it is using resources for no reason.

I tried to use the common answer for the authen/authz handlers, to decline
if $r->is_initial_req, but
then the value doesn't get set in the Request Note for the OutputChain
subclass, since it doesn't
run on the internal redirect to 'index.html'.

At this point, the best answer I have is to decline if $r->is_main, but the
TransHandler still runs
twice - once on the first request and once on the internal redirect.

Am I missing something or is there a better way to maintain state across
internal redirects?

Thanks in advance,

Ryan


----------------------------------------------
Ryan Adams                  [EMAIL PROTECTED]
Vitessi Motorsports, Inc.      www.vitessi.com
Voice: 740/362-9254          Fax: 740/362-0354
----------------------------------------------

Reply via email to