This might be better, as is it breaks down a working example. Do you have a good grasp of documentation and/or modules? As far a clearing the cookie, that is done by the expiration date. Have you tried anything on your own yet? If you have, we can help you more easily if you post some of your code that is giving you trouble.
I haven't tried anything with cookies yet, no. I want to start trying to do some cookie stuff, so I can actually have users stay logged in a bit more securely than including their username and password in an URL.