Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: My first website

by Ryszard (Priest)
on Jan 26, 2002 at 06:17 UTC ( [id://141714]=note: print w/replies, xml ) Need Help??


in reply to My first website

Doing session management is easy. For a start you'll need a table that has the usernames/passwords, and a table that will store the session id.

Next you set up a (HTML) page that will allow the user to enter their name and password. This is done by using a form with a submit button on it. (it can be quickly knocked up in frontpage, (or vi) )

You then get the user's name when they press the submit button and check for naughty characters (taint checking).

You then go get the password from the database basaed on the username.

Compare retrieved pwd with the supplied pwd, and set a cookie with a unique sess_id (and stick the sess_id into the session table with an expiry time).

For each user initiated action, (after taint checking all the inputs) you go check to see if the session is still alive. If the session is dead, send back the login page, otherwise let the user do what they requested.

Make sure you use CGI.pm, CGI::Application, HTML::Template, perl -wT and strict for your application.. :-)

As for books, check out the O'Reilly DBI book, and have a look at the Perl CD bookshelf, its expensive, but invaluable, and has stuff from beginers to advanced. For OOP, Object Oriented Perl by Conway is a must have.

Good Luck!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-16 11:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found