ojorus wrote:
I want to make a login system as secure as possible on a website I develop.
First step is to use SSL.
* The user shall log on using a Username and a password (which is stored in
a mySQL database)
Of course, never store the actual password, but some sort of hash of it.
*The server which I use to run my application has "register_globals"
activated (set to "on"), so that has to be taken into concideration
If the server is running apache, use a .htaccess file to turn them off:
php_flag register_globals off
*The system should be secure even if the user do not click "log out" when he
is finished. (Users often just close the browser window)
Use sessions with custom handlers to store the session data in a
database table. Set the following to be sure that all stale session
records are removed when they have expired:
session.gc_probability = 1
session.gc_divisor = 1
Then you can set your session timeout stuff according to your needs
(seconds):
session.gc_maxlifetime = 1440
*It is good if the system works even if coockies are not enabled on the
client
session.use_trans_sid = 1
How can I make a login-system as secure as possible based on this?
Do I have to use session-variables, or are there other ways?
If you want to do it without cookies, you'll need to use sessions, which
may be more secure anyway. That way there are no details kept on client
machine in cookies, making public computer use safer.
I have a system like this that I have used on quite a few sites over on
sourceforge. I haven't updated anything on it for a while, but that's
just because I haven't added any new features or have received any bug
reports. If you're interested, I believe the address is:
http://www.sf.net/projects/phpsecurityadm
However, SF is undergoing maintenance right now, so you'd have to wait
for the site to come back up again. I'm no expert, but I haven't had any
complaints about the methods I use.
--
Justin Koivisto -
sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.
Official Google SERPs SEO Competition:
http://www.koivi.com/serps.php