Ok, I've been running a website for over two years now..switching from HTML, TO ASP and now to PHP..but all this time I had a huge security leak, allow me to explain:
My site has a user registration system, when a user logins I set a cookie containing their username and some other ifnromation (Like what skin they are using on the site). Now the problem occurs, since I'm just storing the username wouldn't someone simply be able to go into their cookies folder, edit the value of the cookie username to be set to another user registered on the site and be able to use their account?
My resolution to this is to now store the users password when they login, then in my header file I would do a check like so: (This isn't actual code, just a overview)
if cookieUsername != ""
Select * from members where username = cookieUsername
Grab the password
if cookiePassword != passwordFromDb
Send them to a 'hacked' page
other wise, continue with the site.
I was wondering if this would work or if anyone has any solutions to security problem.
Thanks in advance for any input.