Re: Bug #1347 Updated: setcookie executes after previous cookie value is read
| From: | Sascha Schumann | Date: | Wed, 12 May 1999 12:09:03 +0000 |
| Subject: | Re: Bug #1347 Updated: setcookie executes after previous cookie value is read | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-5548@lists.php.net to get a copy of this message | ||
On Tue, May 11, 1999 at 11:49:21PM -0500, Brian Moon wrote:
> The problem here is that if the browser is not accepting cookies, you are
> making an incorrect assumption that the cookies are set. If you want the
> var set, you can always simply set it.
The user did not talk about the state between two requests which means that
the client side becomes irrelevant.
He was concerned about one request. Within this request, the script set a
cookie, but was not able to access the content of the cookie.
This sounds logical to the PHP programmer, but is not straightforward to the
ASP guys where they have some kind of a class (?) which stores the current
state of the cookie machine.
The same functionality could be easily implemented in PHP3. Something along
the line...
class cookie {
var $cookies = array();
function cookie() { read $HTTP_COOKIE_VARS into $cookies }
function set_cookie(...) { SetCookie(), update $cookies array }
function read_cookie(...) { return something from $cookies }
}
--
Regards,
Sascha Schumann
Consultant
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net