I have a weird problem,
If I try to set a session var in a page that also has a header:location... redirect, the variables get unset from the session. This only happens when using the cgi setup instead of apache module. If I die() before the header call, the variable stays for good. Note that this is not a problem with passing session var as all of it is fine. Something is clearing that last variable from the session. I can watch the content of the /tmp/session... file and see it change as I go.
I am using globals off, 4.2.1-4.2.3, and setting my session vars directly with $_SESSION['myvar'] = ....
I believe this is a bug but I'm throwing it out here first. Note that I am also sending other headers (no cache stuff) as wel as output buffering. I did turn that off to no effect though. I wonder if the fact that the redirect prevents my script from cleaning up (sending the headers, ob-flush, etc..) may be a problem.
Any suggestions appreciated..
Joshua
Sample script:
<?php session_start();
//set the session var
$_SESSION['one']= "hello";
//at this point it is set in the session - check sess file
echo $_SESSION['one'];
//if you comment this out and refresh, you get the session var.
//but if the redirect happens the variable gets unset. Note that
//if the variable is set previously, and then you add the redirect,
//it is not affected.
header("Location: [url]http://www.php.net[/url]");
//this doesn't happen with the php module with the exact same config
//The only diff is that cgi has force-redirect on and module has apxs
?>