Thanks all!
Can you honestly say that you will never want to allow any whitespace on any piece of data anywhere in your database?
Yes
How is $login defined?
$login is the email address/username and therefore is POST data.
Consider using at least SHA1, and also note that it's wise to use a salt when hashing passwords as well. Yes I am aware of MD5 issues, I will now use SHA1 instead. Plus, I am using a site-wide salt. Maybe to improve the security I could create a pre-user salt in MySQL?
Don't do a 'SELECT ' - instead, only SELECT the columns from which you actually need data (even if that's all columns in the table, I still consider it 'better' to name all of them rather than doing a 'SELECT ').
I will update my code with this.
Er.. is that a typo? You set $SESSION['MID'], and yet you're checking for $SESSION['SESS_MEMBER_ID']?
yes, Typo erro, Fixed now 🙂
Are you doing all of this over a secure (e.g. HTTPS) connection?
When we go live I will add HTTPS but until then no.
How does using MySQLi and prepared statements "improve" security at all? (Hint: It doesn't.)
Good because I don't understand MySQLi 😛
Are you suggesting I stick with good old setting SESSION as authentication?