a easy way to handle cookie