I have 2 php pages : https://mydomain/form.php and https://mydomain/paynow.php
The script form.php has the following partial code :
form.php
session_start();
date_default_timezone_set(@date_default_timezone_get());
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);
@header("Content-Type: text/html; charset=UTF-8");
//Some sessions are created after
.......
The script paynow.php has the following partial code :
session_start();
date_default_timezone_set(@date_default_timezone_get());
error_reporting(E_ALL & ~E_STRICT & ~E_NOTICE);
@header("Content-Type: text/html; charset=UTF-8");
echo "<pre>";
print_r($_SESSION);
echo "</pre>";
The script form.php is redirecting to the paynow.php script using:
echo "Redirecting you to the Payment page, please wait...";
echo "<script type=\"text/javascript\">top.location.replace('https://mydomain/paynow.php')</script>";
exit;
On the paynow.php the session array is empty when I change the url to top.location.replace('http://mydomain/paynow.php')
it works fine.
Any thoughts why that is happening please?