I have a legacy application that handles auth and sets some session variables; I need access to those session variables in a Laravel app. I tried starting a session and accessing one of the variables in a controller - this did not work. I get a Whoops Error - Undefined index: name
Here is what I tried:
public function __construct()
{
session_start();
}
public function index()
{
//test output php (not Laravel) sessions
echo "TEST CONTROLLER ACCESSED!!\n\n";
print_r($_SESSION['name']);
}
I also tried the same method in a closure within the route. Both failed.
Is there a way to access the PHP native session variable within Laravel?
Edit
I do not understand my question being marked as a duplicate. The answer referenced is regarding the error that I get. It does not answer my question. I understand what the error means, I need to know why the session is not available to Laravel.
Please let me know of any additional information you need.
Edit 2
$_SESSION['name'] exists in the legacy app, but is not passed to Laravel. Both apps are on the same server and domain. How can a trace what is happening?