On Wednesday 20 February 2002 07:55 pm, Geoffrey Young wrote:
> > If the redirected request needs that session
> > data, there's a small chance it won't be there yet.
>
> have you seen this?  I don't recall this ever coming up before (which
> doesn't mean it can't happen :)

Yes, I have seen it happen. Quite frequently in fact. My investigation into 
the problem is how I discovered the cleanup handler wasn't doing its job in 
time.

> perhaps your post-content code in a PerlLogHandler instead of a
> PerlCleanupHandler might help if you are running into problems.  the
> browser isn't released from the current connection until logging is
> complete, so there wouldn't be the chance that a redirect would be
> processed before the session is created.

I moved the session cleanup phase to a PerlLogHandler and it seems to be 
working, except for one small issue. Request URIs for directories (i.e. no 
filename specified) don't seem to trigger the log handler. I put some 
warnings in the code to trace its execution. The following is a dump of my 
logs following a test run:

[Thu Feb 21 15:02:46 2002] [warn] SessionPrepare called for GET 
/iddb/target/index.pl
[Thu Feb 21 15:02:46 2002] [warn] SessionPrepare called for GET 
/iddb/target/index.pl
[Thu Feb 21 15:03:15 2002] [warn] SessionPrepare called for POST 
/iddb/target/login.pl
[Thu Feb 21 15:03:15 2002] [warn] SessionCleanup called for POST 
/iddb/target/login.pl
[Thu Feb 21 15:03:15 2002] [warn] SessionPrepare called for GET 
/iddb/target/list-portals.pl
[Thu Feb 21 15:03:16 2002] [warn] SessionCleanup called for GET 
/iddb/target/list-portals.pl
[Thu Feb 21 15:03:18 2002] [warn] SessionPrepare called for GET 
/iddb/target/index.pl
[Thu Feb 21 15:03:18 2002] [warn] SessionPrepare called for GET 
/iddb/target/index.pl
[Thu Feb 21 15:03:18 2002] [warn] SessionPrepare called for GET 
/iddb/target/list-portals.pl
[Thu Feb 21 15:03:19 2002] [warn] SessionCleanup called for GET 
/iddb/target/list-portals.pl
[Thu Feb 21 15:04:36 2002] [warn] SessionPrepare called for GET 
/iddb/target/index.pl
[Thu Feb 21 15:04:37 2002] [warn] SessionCleanup called for GET 
/iddb/target/index.pl
[Thu Feb 21 15:04:37 2002] [warn] SessionPrepare called for GET 
/iddb/target/list-portals.pl
[Thu Feb 21 15:04:38 2002] [warn] SessionCleanup called for GET 
/iddb/target/list-portals.pl

The first two lines are the browser's initial request for /iddb/target and 
the subsequent redirect by Apache to /iddb/target/ and ultimately translated 
to /iddb/target/index.pl. Notice that the fixup handler fires for both, but 
the log handler doesn't. In lines seven and eight, I re-issued the initial 
request and received the same result -- no log handler. However, in lines 11 
and 12, I manually entered /iddb/target/index.pl into the browser's address 
line. This time the log handler was called.

Bug or feature?

-- 
Milo Hyson
CyberLife Labs, LLC

Reply via email to