Hi there,
Which one is better to use for user's authentication, cookies or sessions?
I just started coding a nice script for handling User's signUp and login using cookies, and I found that if the user forgot to logout and the cookie is not expired yet, any one can log to any page using the first guy userName and password in the same PC, cause I put at every page a small code to grab the userName and password from the cookie I set.
So, any idea how I can delete the cookie automaticaly when the user close the session and forgot to logout?
Which one is better to use for user's authentication, cookies or sessions?
I just started coding a nice script for handling User's signUp and login using cookies, and I found that if the user forgot to logout and the cookie is not expired yet, any one can log to any page using the first guy userName and password in the same PC, cause I put at every page a small code to grab the userName and password from the cookie I set.
So, any idea how I can delete the cookie automaticaly when the user close the session and forgot to logout?