Forum Moderators: coopster
Sometimes, on the page2.php, when I click RELOAD button after about 10 sec, the variables $user and $pw are not displayed as if they did not exist anymore.
("sometimes", i.e. "yesterday it works fine but today, the problem appeared"...)
Here is the code I'm using (two pages, PHP 4.0.4):
// PAGE1.php
<?
session_start();
session_register("user");
session_register("pw");
$user = "hello";
$pw = "world";
?>
<H3>Session Variables Initialized</H3>
$user = <? echo $user;?><br>
$pw = <? echo $pw;?><br>
<br>
Go to <a href="http://whatever.com/page2.php">next page</a>
// PAGE2.php
<?
session_start();
if ($go == "RELOAD") {
Header("Location: [whatever.com...]
exit;
}
else if ($go == "RESET") {
session_unregister("user");
session_unregister("pw");
}
else if ($go == "FIRST") {
Header("Location: [whatever.com...]
exit;
}
?>
<H3>Second page</H3>
$user = <? echo $user;?><br>
$pw = <? echo $pw;?><br>
<br>
<form action=<?echo $PHP_SELF;?>>
<input type=submit name=go value=RELOAD>
<input type=submit name=go value=RESET>
<input type=submit name=go value=FIRST>
</form>
Does anyone have an idea if some configuration parameters are involved or ...?
Thanx
session.use_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.serialize_handler = php
session.gc_probability = 1
session.gc_maxlifetime = 1440
Here, I'm using cookies that expires only when the browser is restarted. So, I should keep my session variables?!
Did anyone meet the same problem?