First off, the PHP code:
header("Content-Type: text/html; charset=utf-8");
header("Cache-Control: no-cache, must-revalidate"); // HTTP 1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
global $SESS, $DB, $IN, $FNS;
//SET COOKIES
$segment_2 = $IN->SEGS[2];
$segment_3 = $IN->SEGS[3];
$texpire = time()+2592000;
$FNS->set_cookie("country",$segment_2,$texpire);
$FNS->set_cookie("city",$segment_3,$texpire);This occurs at the very top of the template. PHP is set to ouput. And it all works, with one bug that ruins it all, and that is that the page this codes is on always has to be reloaded for the cookies to be updated. For example, if I visit the page at http://www.domain.com/mypage/oregon/portland, nothing happens. But if I then hit reload, the cookie is properly set. I can’t help but think it’s an odd caching issue (hence the headers being set in PHP at the beginning) but nothing helps.
FYI, generate page headers is turned on in my config. I’ve tried this with that setting off as well, but no dice.
Help!