An existing Perl script is used to authenticate users when they login and is then called to verify authentication and permissions. We want to maintain the existing functionality while adding the ability to use session variables that can be called from any part of the site to verify a user has logged in. Also required is adding the setting of a cookie with user info. The existing script ([url removed, login to view])needs to be modified as described here:
1. Create new sub routine to clear old sessions, create a new session and set session variables with session is, user id and a "logged_in" value.
2. Create a new sub routine to create a cookie with userid and pass that has expiration of 3 months. (this will allow auto login to return users)
3. Modify existing sub routine (auth_check_password) to look for "logged_in" session and then return the same information it now does
4. Modify existing sub routine (auth_check_password) so that if no session login is detected, check for the cookie and execute the login code to verify the cookie userid/pass.
This will require using the Perl CGI::[url removed, login to view] - a perl module that may need to be installed.