RE: [PHP] setcooke(...) before header("Location: XYZ") - Cookie doesn't set!

From: Date: Wed, 22 Jan 2003 07:53:50 +0000
Subject: RE: [PHP] setcooke(...) before header("Location: XYZ") - Cookie doesn't set!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-132523@lists.php.net to get a copy of this message
Mike IIRC this is a known bug with IIS (not PHP) when it gets the http redirect it junks the cookie - sorry I can't remember much more detail than that... Workaround maybe is to spit out an HTML based META refresh redirect tag instead of using the header() call. HTH Rich -----Original Message----- From: Mike Potter [mailto:mike@mikenbob.com] Sent: 21 January 2003 15:35 To: php-general@lists.php.net Subject: [PHP] setcooke(...) before header("Location: XYZ") - Cookie doesn't set! HELP! I know I'm new at this so please don't laugh. But I can't get this to work! I am using Microsoft IIS with the latest PHP installed. Here's a smple: . . . setcookie("testCookie", "testValue", time() + 3600, "/"); header("Location: http://newpage.php"); exit; Later, I pull the cookie: echo $_COOKIE["testCookie"]; and there is no value. If I don't use the header function at the end, and write something to the page, it works fine. Why does this cookie not get set? Thanks a ton! Mike

« previous php.general (#132523) next »