I have two simple pages(test.php, test2.php).
test.php
<?php
session_start();
$_SESSION['username'] = "wria";
echo '<a href = "test2.php">click to another page</a> <br>';
if($_SESSION['username']) {
echo $_SESSION['username'];
}
?>
test2.php
<?php
session_start();
var_dump($_SESSION);
if($_SESSION['username']) {
echo $_SESSION['username'];
}
?>
in the output,
when I open test.php, after a refresh
but when I go to test2.php, the output appears:
nothing showing.
Note: this file is on real hosting not local.