I remember weeks ago I asked about making a login using sessions and md5 phrase. I just came across a question:
To make login using md5, we register 2 session variables $uid, $hashid then on every page we check whether the $hash can be recreated using the $hid. This should avoid people manually typing a different $uid to see other user's info.
My question is, since the $hid was registered into the session, the user should not be able to change its value. So even the user type ?uid=123 in the URL it won't change the session variable $uid. If that's the case then why do we have to use md5() to check the combination everytime?
Since user cannot session_register a session variable, shouldn't it be safe?
Please correct me if I am wrong.
Thanks!