--- 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