I was wondering if there’s an issue with this?
I’m including a file that has session variable, but I’m trying to get that session variable from the included file, but its not passing through?
index.php
<?php
session_start();
session_regenerate_id();
ob_start(); // Initiate the output buffer
include("file.php");
echo $_SESSION['name'];
?>
file.php
$_SESSION['name'] = "Andrew";
my index.php file is not echoing anything.
Thanks
add
at the beginning of the file
and add
to file.php
because without
file.php is read as html