Which part of the perl auth handler should do this cleanup
Just to add though -- if you really want to do a cleanup within MP, use the cleanup handler which works after the client connection is terminated. also try setting a global timestamp so you only do the cleanup code once every 15 minutes or so, instead of on every request.