note 62136 added to function.setcookie
| From: | Alex at osu1 dot php dot net | Date: | Tue, 21 Feb 2006 03:14:38 +0000 |
| Subject: | note 62136 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-104101@lists.php.net to get a copy of this message | ||
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...
----
Server IP: 216.194.113.175
Probable Submitter: 24.147.62.158
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+62136
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+62136&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+62136&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+62136&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+62136&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+62136&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+62136&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+62136&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+62136&report=yes
Search -- http://master.php.net/manage/user-notes.php