TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 09-08-2007, 04:23 PM   #1 (permalink)
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, 1225 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)
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 10:00 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design