Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Answer: How can I authenticate HTTP sessions ?

by btrott (Parson)
on Apr 12, 2000 at 19:38 UTC ( #7392=categorized answer: print w/replies, xml ) Need Help??

Q&A > CGI programming > How can I authenticate HTTP sessions? - Answer contributed by btrott

To really protect those documents, you'll probably need to basically re-authorize the user on each request. You can either roll your own authentication, or you can use the HTTP basic authentication scheme.

If you choose the former, you'll probably want to have a login screen; then authenticate the user, set a cookie, and let the user view the documents. On each request for a document, check for the authentication cookie: if it exists, let the user view the doc; if it doesn't exist, make the user log in again.

If you choose to go with basic authentication, you'll want to authenticate out of your database, since you already have the username/password info in there. Check out Apache::AuthDBI (on CPAN) for doing basic authentication out of a database for which you have a DBI driver.

  • Comment on Answer: How can I authenticate HTTP sessions ?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[hippo]: See also Getting Started with Perl for some gentle introductory tutorials.
[thao4]: I don't see where I can post my question. I am french so not good in English
[erix]: go to the bottom of this page: Seekers of Perl Wisdom

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2018-02-21 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (276 votes). Check out past polls.

    Notices?