Logon.pl

This is an easy to set up and use cgi "Log On" sub-routine that can be included with any cgi script to add password protection. It offers lightweight security and can be used with SSL for more complete security. Fairly well commented, it includes examples of using CGI.pm to create server side "Session" files and client side "Cookies" to authenticate and maintain "State" with a user. Features include Logon/Logoff, session time outs, auto deleted expired session files, and it runs clean with both the "-w" and "-T" perl switches on.

You can test it with a simple cgi script here. You'll need to use this username and password;

Username: bill

Password: bill

You can view and save the code for all the files:

Test.cgi

LogOn_setup.pl

Logon.pl

Session Files