improvement

use `for` loop to destroy the cookies once the cookie is invalid.