I'm not sure how this would matter since the cookie is never set at all..
it's not an issue of it reading the cookie, as it can't read what is never
set.  I'll give it a shot when I get home though anyway.

-----Original Message-----
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Monday, December 09, 2002 4:31 PM
To: Chad Day; php general
Subject: Re: [PHP] Cookie handling, NS 4.x?


--- Chad Day <[EMAIL PROTECTED]> wrote:
> I am having a fairly confusing problem with setcookie()
> in NS 4.x.
>
> My script:
>
> nscookie.php:
>
> setcookie("NSUSERNAME", 'cday', time()+2592000, '/',
> ".mydomain.com");
> Header("Location: nscookie2.php");
> exit();
>
> nscookie2.php:
>
> echo $_COOKIE[NSUSERNAME];
>
> In IE (all versions I have tested), this works fine.
>
> In NS 7, this works fine.
>
> In NS 4.7 and 4.8 .. nothing is returned.  No cookie is
> set in the
> cookies.txt file at all.
>
> Can anyone tell me why?

I believe this has something to do with the fact that the
HTTP response status code is no longer a 200 when you send
a Location header, as PHP will automatically change it to a
302 for you. Thus, in some browsers, the result is that the
browser will submit a GET request for the URL identified in
the Location header, but it will ignore the HTTP headers
sent in the 302 response.

To see if this is in fact the trouble with Netscape 4.x,
try using a meta tag redirect instead. Even though the W3C
dislikes this use of http-equiv, it is very consistently
supported, and I know many Web sites that use it
(SourceForge, for example).

Good luck.

Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to