Jump to content

Checking cookies


Mutley

Recommended Posts

I just made a cookie with someone elses username in and I could log in to their control panel - whoops! The actual login creates an ID cookie and a Password cookie (which is encoded, the username ID cookies isn't).

So my pages must only check the username cookie and not verify the password! I can't believe how easy it was.

This is my config file:
[code]
$logged = MYSQL_QUERY("SELECT * from users WHERE id='$_COOKIE[id]' AND id='".$userid."' ");
$logged = mysql_fetch_array($logged);
[/code]

Which completely ignores the password cookie, I don't have a clue how to make it work, to decode the cookie and check if the login is correct.

Link to comment
https://forums.phpfreaks.com/topic/32326-checking-cookies/#findComment-150782
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.