note 56646 added to function.setcookie
| From: | tohe at centrum dot cz | Date: | Sat, 10 Sep 2005 19:40:34 +0000 |
| Subject: | note 56646 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94998@lists.php.net to get a copy of this message | ||
It's needed to globalize array $_COOKIES or $HTTP_COOKIE_VARS if it's used inside a
function, like
<?
function getcookie($name){
global $HTTP_COOKIE_VARS;
if(!isset($HTTP_COOKIE_VARS[$name])) return false;
return $HTTP_COOKIE_VARS[$name];
}
?>
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56646
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56646&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56646&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56646&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56646&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56646&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56646&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56646&report=yes
Search -- http://master.php.net/manage/user-notes.php