I have a simple php page that set the session and redirect to another page but for some reason the session is empty in the second page.
index.php
<?php session_start(); ?>
<?php
$_SESSION['name'] = "Saeed";
echo $_SESSION['name'] ; <<< it shows the correct output
echo '<script type="text/javascript">window.top.location="otherpages/page.php";</script>';
?>
page.php
<?php session_start(); ?>
<?php
echo "session>>>".$_SESSION['name'];
?>