Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: (newrisedesigns) .htaccess and Cookies

by newrisedesigns (Curate)
on Jun 26, 2002 at 04:15 UTC ( #177297=note: print w/ replies, xml ) Need Help??


in reply to htaccess and cookies

Well, i'm not so sure how to send back headers that would allow you to sign in a user through Apache UserAuthentication (your first one), but I don't think you want to do that anyway, unless you don't mind having large .htpasswd files :)

What your asking for is quite large, so I'll try my best to explain some of this, but you'll need to find some other tutorials (i have some links).

Considering your second point, this is a perfect task for (drumroll) CGI.pm!

First of all, Cookies are tidbits of information that your server sends to the user's browser, where it is stored. The stored info is then sent back when a new request is made to your site. I'm sure there's a better explanation out there, but I'm trying to keep it simple.

Those cookies will hold your users' username and password. Everytime they make a request to your page/program, it will receive the cookies, and then act on what it finds. The program will check the cookie information with the names/passwords you have stored on the server and compare. If they pass your specifications (usually matching, case-sensitive), you allow the user into your content.

Here's where CGI.pm comes in. CGI.pm is a wonderful module. It does nearly everything, except bring you pizza and beer. You can easily set cookies, and retrieve cookies with a few (one or two) lines.

Now, you're going to have to face some security issues (fake/spoof cookies), and some functionality issues (browsers without cookie support), so I suggest after getting your code together, submitting it here or having someone experienced in CGI to look at it.

Best of luck to you, and if you need any help, just ask!

John J Reiser
newrisedesigns.com


Comment on Re: (newrisedesigns) .htaccess and Cookies

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://177297]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2014-12-20 21:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (99 votes), past polls