$value) { if (strlen($value) > 3000) { setcookie($name, '', time()-1000, '/', 'play.pokemonshowdown.com'); setcookie($name, '', time()-1000, '/', '.play.pokemonshowdown.com'); setcookie($name, '', time()-1000, '/', 'pokemonshowdown.com'); setcookie($name, '', time()-1000, '/', '.pokemonshowdown.com'); $cleaned = true; } } if ($cleaned) { echo 'alert("You had a cookie which was too big to handle and had to be deleted. If you had cookie settings, they may have been deleted.")'; }