RayBanJockey
09-20-2006, 09:55 AM
Hello,
Maybe you can help me with this. Been searching the web a lot to no avail.
My problem is basically this: When I include a .php file somewhere in the original php file, the included file doesn't inherit the session. I don't do a session_start() in the included file, and I'm certain the one in the original file is before any output. I don't get any error messages at all, the session variables are just blank.
ORIGINAL.PHP
<?
session_start();
$_SESSION['myVariable'] = 1;
include('INCLUDE.PHP');
?>
INCLUDE.PHP
<?
echo $_SESSION['myVariable'];
?>
Output is blank, nothing, as $_SESSION['myVariable'] isn't found in the included script.
Any ideas?
Thanks,
Alex
Maybe you can help me with this. Been searching the web a lot to no avail.
My problem is basically this: When I include a .php file somewhere in the original php file, the included file doesn't inherit the session. I don't do a session_start() in the included file, and I'm certain the one in the original file is before any output. I don't get any error messages at all, the session variables are just blank.
ORIGINAL.PHP
<?
session_start();
$_SESSION['myVariable'] = 1;
include('INCLUDE.PHP');
?>
INCLUDE.PHP
<?
echo $_SESSION['myVariable'];
?>
Output is blank, nothing, as $_SESSION['myVariable'] isn't found in the included script.
Any ideas?
Thanks,
Alex