[Q] session variables wouldn't keep contents.
| From: | Chung Ha-Nyung | Date: | Tue, 13 Mar 2001 06:19:51 +0000 |
| Subject: | [Q] session variables wouldn't keep contents. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-43628@lists.php.net to get a copy of this message | ||
Hi guys,
Some php programs doesn't seem to work normally in a certain
server. Those wokred correctly in my Debian box.
Session is the problem.
It seems that the contents of session variables disappears after
reloading the php page. Here is the program.
---- test.php ----
<html>
<body>
<?php
session_start();
if(!session_is_registered("name")) {
echo "session is not registered<br><br>";
session_register("name");
$HTTP_SESSION_VARS["name"] = "test";
echo "newly registered<br><br>";
}
$session_name = $HTTP_SESSION_VARS["name"];
echo session_encode()."<br><br>";
echo "session_name = $session_name";
?>
</body>
</html>
---- test.php ----
Can I handle it with only php configuration file? Or Do I have to
modify my php programs?
In addition to this, I have a few questions about the work of session
in php 4.0.4
Q1) Do I have to use session_start() explicitly although session.auto_start
is set to 1 in php.ini?
Q2) Do I have to use session_register("variable_name")?
In my Debian woody box, it seems to run well without it.
Regards,
--
Chung Ha-Nyung <alita@kldp.org>