The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> PHP Development
|
PHP-Security - PHP and session/security management
Discuss PHP and session/security management in the PHP Development forum on Dev Shed. PHP and session/security management PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

October 30th, 2012, 08:47 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 5
Time spent in forums: 1 h 18 m 41 sec
Reputation Power: 0
|
|
|
PHP-Security - PHP and session/security management
Hello all,
I am new in this forum.
I am developing a web portal and I need to develop a login/user management system.
Could someone tell me which is the best method to manage a login/user management system in my web portal?
Using MySQLi, password encryption, session or something else.
I would like also to know if you could post me some reference, tutorial, example or other materials on web where I could retrieve some examples or ideas.
Thank you at all in advance
Bye bye
Zipgem
|

October 30th, 2012, 10:01 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
Hi,
there are many things to consider, so this isn't really something you could explain in a few sentences.
I think the most important things are: - Always escape data before inserting it into an "executable" context. For databases, use prepared statements with the MySQLi library or the PDO interfaces. For HTML, use htmlentities() and make sure the user cannot inject JavaScript code
- Use phpass for the password hashes. Do not use plain hashes (like MD5), encrypted passwords or even plaintext passwords. And don't store the hashes anywhere outside of the particular database field (not in the session, a cookie etc.)
Some attacks like CSRF and things like resetting the password require special security measurements.
And there's common sense, of course. For example, storing the user ID in a cookie obviously isn't a good idea.
A good reference is the OWASP, especially the OWASP Top 10.
Last edited by Jacques1 : October 30th, 2012 at 10:03 AM.
|

October 30th, 2012, 10:14 AM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 5
Time spent in forums: 1 h 18 m 41 sec
Reputation Power: 0
|
|
|
Hi Jacques1,
thank you for the useful informations that you provide: I will take a look both phpass and OWASP.
I don't want to use cookie but only session.
Do you know some books that explain security and user management?
Thanks again.
br
zipgem
|

October 30th, 2012, 10:23 AM
|
 |
Likely to be eaten by a grue.
|
|
Join Date: Oct 2006
Location: Pennsylvania, USA
|
|
__________________
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
|

October 30th, 2012, 10:24 AM
|
 |
pollyanna
|
|
Join Date: Jul 2012
Location: Germany
|
|
Quote: | Originally Posted by zipgem I don't want to use cookie but only session. |
Well, there's nothing wrong with cookies. You just shouldn't use them for critical data.
In fact, the session ID is usually stored in a cookie.
Quote: | Originally Posted by zipgem Do you know some books that explain security and user management? |
I don't know a book about that, but there are plenty of resources on the Internet.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|