Originally posted at http://blog.kevindonahue.com
I presented Jennifer with a question: How do I remove skins? or –to be more specific– How do I let users delete their skin preferences and use the current default?
I skin my site based on the examples provided by Brenna and Amy. There is always good info at Girlie's site and lots of others.
In order to delete the cookie, the user has to request the page that deletes the cookie. On my site, that page is http://blog.kevindonahue.com/skins/reset.php. So a link that looks like this:
<a href="http://www.yourdomain.com/reset.php">reset skins</a>
connects to a page that deletes the cookie called "skin" using this php:
<?php
setcookie('skin',",time(),'/');
setcookie('skin',",time(),'/','.yourdomain.com');
header('location: http://www.yourdomain.com');
?>
Notes: The first two lines set the cookie to nothing (that's not a double quote in there, it's two single quotes with nothing in between them) – and the last line redirects them to your whatever page you want to put there. You don't need anything else on that page except that code. The name of the cookie ('skin') must be the same name as the cookie you are setting when the user selects their skin preference. For me, that takes place on a page called "testskin.php".
Again, this is the solution that works for me. Your milage may vary, depending on how you have implemented skins on your site. I would really like for other sites to consider implementing this concept, as it would save me the trouble of deleting their cookies periodically to see what skin they're currently featuring. I'm not much help for configuring it to work for you.