I have been unable to figure out this problem - it just doesn't make any sense.
The server is PHP 5.2.6 running on Windows NT PDP-IIS 5.2 build 3790.
First I have confirmed sessions ARE working via this test script:
<?php
session_start();
if (!isset($_SESSION['counter'])) $_SESSION['counter']=0;
echo "Counter ".$_SESSION['counter']++.".<br><a href=".$_SERVER['PHP_SELF'].">reload</a>";
?>
The counter increments - it works.
My site is using a custom built MVC framework (I wrote it), and I put the last code of the app function to this for testing purposes:
echo session_id(); echo '<pre>'; var_dump($_SESSION); echo '</pre>';
session_write_close(); exit();
The first few lines of this file are:
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
session_start();
The session dumps and looks as expected. Now I go to the server and open up the session file - and the result appears to depend on what browser I'm using. For Chrome and Safari, the session file was empty. For Opera and IE8 the session file looked fine. I'll get to FireFox in a minute - but at this point FireFox appeared fine.
So for testing purposes immediately following session_start() I added the following lines:
$_SESSION['bogus'] = -5;
$_SESSION['test'] = 'other';
I closed my browsers and tried the site again so I could be sure I had a new session. Again Opera and IE8 session files appeared fine. Both Chrome and Safari had the 'bogus' and 'test' values, but my other SESSION value was missing. FireFox at first had the same problem as Chrome and Safari at this point - but upon refreshing the page, the rest of the session showed up. Refreshing did not help Chrome or Safari.
Here is what the var_dump looks like at this point:
array(3) {
["bogus"]=>
int(-5)
["test"]=>
string(5) "other"
["saved_form"]=>
array(1) {
["dgvSJM"]=>
array(4) {
["method"]=>
string(4) "post"
["processor"]=>
string(0) ""
["formid"]=>
string(10) "searchForm"
["fields"]=>
array(2) {
["searchTerm"]=>
array(5) {
["label"]=>
string(10) "SearchTerm"
["type"]=>
string(6) "search"
["required"]=>
bool(false)
["multiple"]=>
bool(false)
["selectempty"]=>
string(6) "B5BMXw"
}
["formInput_0"]=>
array(5) {
["label"]=>
string(0) ""
["type"]=>
string(6) "submit"
["required"]=>
bool(false)
["multiple"]=>
bool(false)
["selectempty"]=>
string(6) "TkZUfo"
}
}
}
}
}
I created a different website with a different subdomain, and copied my code exactly over - and it works fine 'saved_form' shows up perfectly in the session files. So I tried deleting the original website and recreating it - didn't help the problem.
Anyone know what is going on and/or how I can fix it?
Thanks.