Home: Perl Programming Help: Advanced:


Oct 11, 2001, 3:40 AM

Views: 2074

I want to provide a single user with access to a virtual control panel.

How do I make the directory which hold the data secure and password protect that area?

Also How do I get the user to enter a username and password via the standard windows or netscape password required form?

Any help gratefully received.




Oct 12, 2001, 3:45 AM

Views: 2065
Re: Security

Password direcories needs to be supported by your server. It's done with a .htaccess file, but I don't know the details.

To make a control panel (for administrators only), you need to make an login screen (HTML). A CGI application will eventually make a cookie (both user and pass), and return that cookie in the header of a next 'You're logging in' document. If the browser stores the cookie, you're logged in.

It's even possible to crypt the password with the crypt() function (see the perldoc for it's usage). Finally, it's better a make a secure cookie, which is transfered only when a https connection is established.

My forum www.cool-programming.f2s.com uses such techniques.

Off course, you can place your control panel CGI in a password protected directory, which is much better (I never did it however).