note 14372 added to function.setcookie.php

From: Date: Sat, 28 Jul 2001 07:45:46 +0000
Subject: note 14372 added to function.setcookie.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-15976@lists.php.net to get a copy of this message
I found that Netscape chokes on the cookie function when accompanied by a header-location function in the form: header ("Location:authtest.php"); The error message is "The documents contained no data." and occurs in, at least, Navigator 4.7x for Mac and 6.0 for Windows. This also occurs when the location is either explicit, contained in a variable, or is represented by the special variable $PHP_SELF. Of course, when the user cancels the error and presses submit once more, Netscape takes the cookie and doesn't throw up. I bought a clue from the discussions here under "header()" and found success when I added merely a question mark at the tail of the location document, as follows: header ("Location:authtest.php?"); Now Netscape swallows the cookie on the first button press and is happy. And so am I. And I'm just a newbie... but a happy one. http://www.php.net/manual/en/function.setcookie.php

« previous php.notes (#15976) next »