i have a first PHP file:
/home/www/subdomain1.domain.tld/file.php
<?php
session_start();
$_SESSION['foo']='bar';
include "/home/www/subdomain2.domain.tld/foo2.php";
?>
and /home/www/subdomain2.domain.tld/foo2.php:
<?php
session_start();
echo $_SESSION['foo'];
?>
The “include” in the first file generates a “500 Internal Server Error”, i think it’s because session variables are not passed to included files, how can i fix that?
Thank you
Alex
EDIT:
I must use session variables in order to use these variables on every php file on subdomain2.
You don’t need to use sessions when including a file. It is all the same request with the same namespace.
file.php:
foo2.php