Hi all,
In the login systems on the web, I have found that some use sessions and some others use cookies to validate a login.
Normally for login systems with sessions, a hashed login string is created using say the password and HTTP_USER_AGENT is stored in a $_SESSION['logincheck'] variable.
$login_check = hash('sha512', $password . $user_browser);
and Before access is provided to the secure login page this SESSION variable is checked against a hashed string created again from values of password retrieved from the database again.
$_SESSION['logincheck']== $login_check
and if the two are same then the user is allowed to access his secure area.
A similar approach is also provided in some cases where cookies are used. The values stored in cookies are checked against hashed values created with values of variables from the database and if they match access to the user page is granted.
What I wish to ask and know is that would it be a good idea or a bad idea to implement both of these in a login system? What would be the advantages or disadvantages in both cases.
I thought that using both would be a good idea but i am not sure. I have also not come across any system where both of these have been used simultaneously.
Thanks all !