I have some static contents in a folder that I'd like to give user access to after they login. This is easy with htaccess. The problem is that I already have a login page, where I store some user information in the CGI::Session. For this particular directory of static contents, I'd like to check whether the user is logged in by checking the CGI::Session, and allow the user to read the files (could be different types: .pdf, .xls, .doc, etc.) if they are already logged in, otherwise send them to the login page. I used to do this in java, where I just write a servlet filter. Can I do this in perl? a simple cgi script, or a mod_perl? Thanks.