Clearing cookies
Moderator: General Moderators
Clearing cookies
Is there a way to clear all cookies from the website using PHP? Another question (little off topic): I have an auto-increment in a table, how do I reset that (bring down to 1 or 0) with MySQL AND phpMyAdmin?
- evilmonkey
- Forum Regular
- Posts: 823
- Joined: Sun Oct 06, 2002 1:24 pm
- Location: Toronto, Canada
Does print_r($_COOKIE) print all cookies, or just ones related to the domain? If it outputs all the user's cookies, I suppose you can cycle through $_COOKIE array and unset them all..something like this
Code: Select all
foreach ($_COOKIE as $cookie_val) {
setcookie ($cookie_val, "", time() - 3600); }