cookies with super global arrays
| From: | Justin French | Date: | Tue, 20 Aug 2002 16:32:03 +0000 |
| Subject: | cookies with super global arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-113357@lists.php.net to get a copy of this message | ||
Hi all,
I can ACCESS a cookie with something like:
<?=$_COOKIE['name']?>
but I can't seem to modify a cookie in the same way:
<?
$_COOKIE['name'] = "new value";
?>
Much in the same way that I *can* do it with $_SESSION.
To change the value of a cookie, I seem to have to set it again, with the
different values.
I *assume* this is expected behaviour, but I thought I'd check, and make
sure that it is.
If at all possible, it'd be a great feature in a future release... have
$_COOKIE respond to new values the same way as $_SESSION. I guess the catch
is that it'd have to be PRIOR to any browser output, to avoid errors.
Justin French