Re: secure login form
- From: Harris Kosmidhs <hkosmidi@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 06 Jun 2008 09:54:17 +0300
Erwin Moller wrote:
Harris Kosmidhs schreef:Hello,
Hi,
while I'm developing sites for some time I never coded a login form with security in mind.
I was wondering what guidelines there are.
For my point of view I'm thinking of using md5 passwords (it's an one way function right?) in db. Is this a correct approach?
What is it you want to protect against excactly?
If you want the avoid the man-in-the-middle eavesdropping on you: Then you need https, as you described.
If you are afraid the username/password you store in your database is hacked somehow, then it can make sense to store them with an md5 hash, which is one-way encryption indeed.
So that means you, as admin of the database, cannot tell what the password is since you only see the md5 hash.
You can check of course if a provided password 'translates' to the stored md5.
Personally, I stopped storing my passwords with a md5 hash in database.
I figured that if somebody can enter my database at will, my site is hopelessly cracked beyound repair anyway. ;-)
And what's your approach now? Clean passwords as text db fields?
Then, if I'm permitted by the server admin I want to use https. Is it as simple as puting the login form in the httpdocs of the https server an when login is successful then I just set a session variable? Will I then be able to read this from a page under http?
You have NO shared session between you http and https pages.
So if you need that, you must build that yourself somehow.
(You can propagate the sessionid from http to https via a form, and let the receiving script use that sessionid for its https session. But be carefull and always remember that your client can set ANY value for PHPSESSID easily). Always try to hack your own site with all the knowledge you have about its internals.
What should look like what I have to build? Let's say you press "log in". It load the (https) login.php which finds out you are a user. Then? A header('http://example.org/loginnext.php?id=$userid') ??
Is there a way not to pass id with GET but with POST without user submitting the form himself?
thanks
.
- Follow-Ups:
- Re: secure login form
- From: Erwin Moller
- Re: secure login form
- References:
- secure login form
- From: Harris Kosmidhs
- Re: secure login form
- From: Erwin Moller
- secure login form
- Prev by Date: EARN DOLLARS WIYH OUT INVESTMENT
- Next by Date: Re: Please check my auth login script
- Previous by thread: Re: secure login form
- Next by thread: Re: secure login form
- Index(es):
Relevant Pages
|