View Single Post
Old 09-08-2007, 04:23 PM   #1 (permalink)
Sam Granger
The Acquainted
 
Join Date: Sep 2007
Posts: 126
Thanks: 4
Sam Granger is on a distinguished road
Default Secure login script.

Had this coded for me by one of my programmers, thought it might come in handy for some of you guys!

Notes:
Quote:
Authentication Class - AuthClass
Syed Imran Moinuddin
23rd September 2006
=================================
General Notes

-> All passwords in the DB must be stored as MD5 hashed.

-> The AuthClass object offers two key functions (not including internal functions):
- authentication($username,$password)
The function will accept the username and password as provided by the user and then proceed to compare the md5 hashed
value of the password with the encrypted password in the database.

- verify()
The function will check the browser session and compare against active sessions in the database and return a boolean to
the caller on the validity of the session. verify can be called on the top of all pages which require security. It is
better to place it in a consistently present include to avoid code repetition.

- logout()
This will destroy session variables associated with the existing login and should be triggered such as when the user clicks
a logout button as well.
Enjoy!!
Attached Files
File Type: zip authclass.zip (4.3 KB, 1224 views)

Last edited by Sam Granger : 09-08-2007 at 04:58 PM.
Sam Granger is offline  
Reply With Quote
The Following 3 Users Say Thank You to Sam Granger For This Useful Post:
Filipe Costa (03-12-2008), subman (03-29-2008), Y.P.Y (01-22-2009)