note 12013 added to function.setcookie.php

From: Date: Sun, 18 Mar 2001 20:03:22 +0000
Subject: note 12013 added to function.setcookie.php
Groups: php.notes 
Request: Send a blank email to php-notes+get-12527@lists.php.net to get a copy of this message
The cookie problem with IIS was a BIG one in both PHPNuke and phpWebSite. I was able to fix the header("Location: ...) problem by using the following: example line: header("Location: user.php?op=userinfo&bypass=1&uname=$uname"); was changed to: header("Refresh: 0;url=user.php?op=userinfo&bypass=1&uname=$uname"); This worked perfectly with my setup (IIS4.0 on NT Server. IE 5.5 as client.). So all I did was run a global search and replace using PERL from my command line (I use ActivePerl 5.6) from my phpNuke/phpWebSite directory on the server: for /R %f in (*.php) do perl -i.bak -p -e "s/Location: /Refresh: 0;url=/g" %f and to catch the inc files: for /R %f in (*.inc) do perl -i.bak -p -e "s/Location: /Refresh: 0;url=/g" %f I know this is specific to phpNuke/phpWebSite, but it got around the entire problem with the Location: header causing all other headers to be ignored. SetCookie() then worked perfectly after the replacement procedure. Hope this helps! I had tried every suggestion on this page, and this one was the only one that worked every time for me! -wade http://www.php.net/manual/en/function.setcookie.php

« previous php.notes (#12527) next »