I have code that uses sessions, but am encountering a strange problem.
If I print_r($_SESSION) at the end of one script, the entire contents
of the session are output to the web page. When I then load another
script, whose first lines are also a print_r($_SESSION), not all the
contents of the session get printed or the contents of the session got
truncated)!

Here is my code in FileA.php:
<?php
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
ini_set("arg_seperator.output", "&amp;");
session_name("cpcs");
session_start();
....
....
<populate variables>
....
....
print_r($_SESSION);
session_write_close();
//---------------------
//--exit(); //--i use this exit() to view the contents of my session
on this script, before loading the next script. at this point, the
session in its entirety gets output to the web page
//---------------------
header("Location: pay_submit.php");
?>


I have also tried transferring to the next script via javascript,
instead of via PHP's header() function, like this:
<SCRIPT LANGUAGE='Javascript'>
<!--
doent.location.href='pay_submit.php'
-->
</SCRIPT>


Here is my code in FileB.php:
<?php
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: public");
ini_set("arg_seperator.output", "&amp;");
session_name("cpcs");
session_start();
print_r($_SESSION);
?>

In FileB, not all the variables in the session get displayed. I
populate all session variables like this: $_SESSION["variablename"] =
"value"; In FileA, I populate most session variables in included
scripts. In fact, the only two variables I populate directly in FileA
are the ones that FileB does not display! That has to be significant,
but what does it mean?

Help!

Thanks in advance.

- Mike