I include this code on top of my php webpage
<?php
ini_set('session.use_cookies', 1);
ini_set('session.use_only_cookies', 1);
session_start();
?>
here is php webpage
a.php
<h1>Page AAAA</h1>
<a href="b.php?t=<? echo time(); ?>">go to page B</a>
<?php
echo "<h2>CURRENT SESSION = ", $_SESSION['test'], "</h2>";
$_SESSION['test'] = 'a';
echo "<h2>AFTER CHANGE SESSION = ", $_SESSION['test'], "</h2>";
?>
b.php
<h1>Page BBBB</h1>
<a href="a.php?t=<? echo time(); ?>">go to page A</a>
<?php
echo "<h2>CURRENT SESSION = ", $_SESSION['test'], "</h2>";
$_SESSION['test'] = 'b';
echo "<h2>AFTER CHANGE SESSION = ", $_SESSION['test'], "</h2>";
?>
but it not work. CURRENT SESSION
is no value even if I switch between a.php and b.php
update I include this code in a.php
echo "<h1>SESSION ID = ", session_id() , "</h1>";
result
SESSION ID = fhhiilg08rl2ajtplqc9dbud43