PerlModule Apache::Filter \
OurStuff::SessionFilter
PerlHandler OurStuff::SessionFilter
SetHandler perl-script
####
package OurStuff::SessionFilter;
use Apache::Constants();
sub handler {
my $r = shift;
$r = $r->filter_register();
my($fh, $status) = $r->filter_input();
return $status unless $status == Apache::Constants::OK();
my $session_id = OurStuff::Session->getCurrent()->id;
# now the hard part: process the $fh filehandle and
# find relative urls, and add &session=$session_id to
# the query string.
# keep in mind that urls can be embedded in javascript,
# such as location.href='...' or window.open(...)
return OK;
}
1;