What I have is a cgi/perl based system that lets a user self-register and then it sets a cookie. It's not a complete system... it's just a means to get the cookie set so some other system can read it and do the authentication.
Now to secure the directory, I wanted to use HTTP Authentication with a generic login/password.
My thinking was to write a perl script to just check the cookie and then use the generic apache login to get into the secure directory.
At this point, I could not get the method above to work since the login is for the "virtual" browser within the perl environment. But I did get an Ajax based script to do the HTTP login, very transparently.