Hi!
Please, a little help to solve this problem.
The scenario is complex, but in the essence it is:
1. content of first-file.php
<?php
session_start();
$_SESSION['s_Foo'] = "pippo";
// this is only a twisted way of producing the header('location: second-file.php'), because unfortunately often I obtain the error "headers already sent".
echo "<!DOCTYPE html><html>";
echo "<head><meta charset='utf-8'></head>";
echo "<body onload='go()'>";
echo "<script>function go(){location.replace(\"second-file.php\")}</script>";
echo "</body>";
echo "</html>";
exit;
?>
2. content of second-file.php
<?php
session_start();
$foo = isset($_SESSION['s_Foo']) ? $_SESSION['s_Foo'] : "nothing";
echo "_".$foo."_";
... here a line that require to use $_SESSION['s_Foo']
?>
Now, I read (in the secon file) "_pippo_", but only for half or one second...
Then disappears "_pippo_", and it is written "_nothing_" whit the php log "Notice: Undefined index: s_Foo in [...]/second-file.php on line 4
Thank you in advance,
Francesco
.
Please, a little help to solve this problem.
The scenario is complex, but in the essence it is:
1. content of first-file.php
<?php
session_start();
$_SESSION['s_Foo'] = "pippo";
// this is only a twisted way of producing the header('location: second-file.php'), because unfortunately often I obtain the error "headers already sent".
echo "<!DOCTYPE html><html>";
echo "<head><meta charset='utf-8'></head>";
echo "<body onload='go()'>";
echo "<script>function go(){location.replace(\"second-file.php\")}</script>";
echo "</body>";
echo "</html>";
exit;
?>
2. content of second-file.php
<?php
session_start();
$foo = isset($_SESSION['s_Foo']) ? $_SESSION['s_Foo'] : "nothing";
echo "_".$foo."_";
... here a line that require to use $_SESSION['s_Foo']
?>
Now, I read (in the secon file) "_pippo_", but only for half or one second...
Then disappears "_pippo_", and it is written "_nothing_" whit the php log "Notice: Undefined index: s_Foo in [...]/second-file.php on line 4
Thank you in advance,
Francesco
.