|Do you know where your variables are?|
CGI Session 'security' for in-house app.by mikeB (Friar)
|on Jul 06, 2001 at 00:06 UTC||Need Help??|
mikeB has asked for the
wisdom of the Perl Monks concerning the following question:
A search of the monestary turned up a plethora of CGI and session nodes, but the ones with interesting titles didn't seem to address this question directly. If I missed one, just point me in the right direction.
I need to add minimal security to an in-house app. It's all inside our firewall so I'm not concerned about outside malicious hacks. The main purpose is to prevent curious employees who stumble across the site from accidently entering data into the system. A secondary use might be storing session data if the system expands beyond its current humble state.
The approach I have in mind is to use a simple login screen to collect a user name and password. The CGI (Perl :)script would verify these against a database table and assign a session key (hash) with a short expiration time, e.g. 30 minutes or so. The session key would be kept in a hidden field on the subsequent forms.
Subsequent invocations of the CGI script would check for the hash in the user table and verify the time, and look up state information if/when it is implemented. Form submissions which lacked a session key, have expired, or have an invalid key would be returned to the login page.
Am I missing anything obvious here? Anything subtle? Fishing poles, bait, and even fish are welcome!