Re: FW: Cookies, Dammit!
| From: | Jamie Burns | Date: | Tue, 16 Jan 2001 21:49:35 +0000 |
| Subject: | Re: FW: Cookies, Dammit! | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34903@lists.php.net to get a copy of this message | ||
oop, i missed an 'exit;' command off...
if (($HTTP_COOKIE_VARS["foo"] != 'bar') &&
($HTTP_GET_VARS["set"] !=
true)) {
SetCookie("foo", "bar");
header("Location: $PHP_SELF?set=true");
exit;
}
----- Original Message -----
From: "Jamie Burns" <jamie.burns@dynamicexpression.co.uk>
To: "Rasmus Lerdorf" <rasmus@php.net>; "Richard S. Crawford"
<rscrawford@mossroot.com>
Cc: <php-general@lists.php.net>
Sent: Tuesday, January 16, 2001 9:47 PM
Subject: Re: [PHP] FW: Cookies, Dammit!
> will this not work...
>
> if (($HTTP_COOKIE_VARS["foo"] != 'bar') &&
> ($HTTP_GET_VARS["set"] !=
> true)) {
> SetCookie("foo", "bar");
> header("Location: $PHP_SELF?set=true");
> }
>
> at the top of the page. or is this what is unreliable on some browsers?
>
> jamie.
>
> ----- Original Message -----
> From: "Rasmus Lerdorf" <rasmus@php.net>
> To: "Richard S. Crawford" <rscrawford@mossroot.com>
> Cc: <php-general@lists.php.net>
> Sent: Tuesday, January 16, 2001 9:02 PM
> Subject: Re: [PHP] FW: Cookies, Dammit!
>
>
> > > 1. Set cookies to a particular value (e.g., foo=hi and bar=ho), AND
> > > 2. Redirect the user to a new page in a different directory? AND
> > > 3. have the new page be able to retrieve the values of both foo and
bar?
> >
> > No, 1. and 2. can not be done in the same request reliably. Some
browsers
> > can handle it, others can't.
> >
> > -Rasmus
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net