0

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?

My sessions configuration are like the following : enter image description here

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
oussama kamal
  • 1,027
  • 2
  • 20
  • 44
  • Check out the top answer on [This Page](http://stackoverflow.com/questions/25803293/session-variables-lost-between-pages) and run through that check list – Josh S. Feb 28 '16 at 14:59
  • I did, the issue is still happening, as I said it works with HTTPS to HTTP and not HTTPS to HTTPS – oussama kamal Feb 28 '16 at 15:03
  • What I can see is that your sessions configuration is appropiate and of the code you have given, it appears to be fine and should work. I'd make sure that all your sessions are set the way you want before the redirect. – Josh S. Feb 28 '16 at 15:16

0 Answers0