Forum Moderators: coopster

Message Too Old, No Replies

Clearing Cookies without knowing the names

         

yesmaster

8:42 pm on Feb 21, 2007 (gmt 0)

10+ Year Member



Hey guys,
First time posting. Anyone know a way to clear out all the cookies under / without knowing the exact names? The only way I found to clear a cookie is by using setcookie(), but you have to konw the exact name.

I tried clearing the cookies by clearing the array $_COOKIE but that didn't work. Any info appreciated.

jatar_k

8:54 pm on Feb 21, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



welcome to WebmasterWorld yesmaster,

you should be able to get the name from the $_COOKIE array

dump it array to see the exact syntax to use

echo '<pre>';
print_r($_COOKIE);
echo '</pre>';

that should show you what you have available

though if it is a cookie from your site then you should know the name

yesmaster

8:57 pm on Feb 21, 2007 (gmt 0)

10+ Year Member



Thanks. I'm working on a security procedure that dectects when someone trying to fake cookie values. When it detects this, I want to clear out the all the cookie values he has for my website.