Hi,
I'm constructing one site with session variables, but something strange is happening.I registered one variable with $_session and after i done a redirect to another page, and tried to show the variables'value. but it doesn't work. I get the same error: "Undefined index: username."
page1:
<?php
session_start();
$_session['username']="test";
header("Location:http://localhost/user_check.php");
?>
page2:
<?php
session_start()
if (isset($session['user'])
echo $session['user'] ;
?>
If i use session_register(page1) instead of $_session, i get the following message:"Undefined index: username."
I looked in forum's archive, and find out that several people have the same problem, but i can't found any firm solution for this problem. The strange is that the file in /temp directory is created with values: "username" and "test"
I suppose that page1 create one separete session that page2 doesn't get access to session's variables that are registered. But i'm not sure.
Does anybody can help me ?
thanks a lot