note 51705 added to function.setcookie

From: Date: Fri, 08 Apr 2005 03:29:46 +0000
Subject: note 51705 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-87685@lists.php.net to get a copy of this message
If you want to delete all the cookies set by your domain, you may run the following: <?php $cookiesSet = array_keys($_COOKIE); for ($x=0;$x<count($cookiesSet);$x++) setcookie($cookiesSet[$x],"",time()-1); ?> Very useful when doing logout scripts and the cookie name may have changed (long story). ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51705 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51705&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51705&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51705&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51705&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51705&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51705&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#87685) next »