I currently have a cookie set as follows:
setcookie(\"username\",$username,time()+3600*24*5);
How would I go about clearing the value of th
Setting its expiration to some time in the past should clear it:
setcookie("username",$username,time()-10);
If you're using PHP sessions to manage users, you'll probably also want to session_destroy()
Be sure that you delete the cookie with the same domain name and path with which you set it. Cookies for example.com and www.example.com will be treated as two different cookies. Similarly, cookies set from example.com and example.com/Support will have different paths. A good practice is to use .example.com as the domain and '/' as the path for username type cookies so that they can be shared across your subdomains too.
To debug this, you can use the FireCookie plugin of Firefox which'll show all this information.
You really should not store your users password in a cookie, especially if you are not using HTTPS! The password will be sent in plaintext over the network for every requests! Also, never send back a user his password, this is nerver a good idea.