note 62136 deleted from function.setcookie by arpad
| From: | arpad@php.net | Date: | Wed, 22 Feb 2006 00:50:47 +0000 |
| Subject: | note 62136 deleted from function.setcookie by arpad | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-104181@lists.php.net to get a copy of this message | ||
Note Submitter: Alex
Reason: bad code
----
I have spent the last, oh 6 months on this- and finally found a simple solution! =)
If you can't seem to delete a COOKIE no matter what you try, set your cookie value to a symbol
(ie. %) on the logout page. Then on the pages you want to protect, do a ctype_alnum(cookie) check.
ie.
if( !ctype_alnum(cookie) )
{
header("Location: http://www.example.com/logout.php");
}
Hope this helps for the people who haven't been able to delete their cookie, or set it to
"", 0, FALSE, NULL etc...