Here are my files:
sess1.php
Code: Select all
<?php
session_start();
session_register("userid");
session_register("textvar");
$_SESSION['userid'] = 10333 ;
$_SESSION['textvar'] = TextVariable ;
echo "<p>User ID is: " . $_SESSION['userid'] . "</p>" ;
echo "<p>Another variable is: " . $_SESSION['textvar'] . "</p>" ;
?>
<p>Go to the <a href="sess2.php">next page</a>.</p>sess2.php
Code: Select all
<?php
session_start();
echo "<p>The userid session variable is: " . $_SESSION['userid'] . "</p>";
echo "<p>The other session variable is: " . $_SESSION['newvar']. "</p> ";
?>sess1.php
Code: Select all
User ID is: 10333
Another variable is: TextVariable
Go to the [next page].
sess2.php
Code: Select all
The userid session variable is:
The other session variable is:
Go to the [last page].- I do have session_start() at the top of both files.
- The variables directory is writable, and the session variables are showing up there. (I have about a hundred little files called sess_b62<snip>, that have this inside: 'userid|i:10333;textvar|s:12:"TextVariable";'.)
- phpinfo() tells me that the php.ini file is being read correctly and the lifetime is set to the default, 0, i.e. until the browser is closed.
Thanks so much.