0

I asked a question on this earlier, but after doing some more experimentation, the mystery is getting stranger. When I logged into my personal computer today, I had to start up my XAMPP servers for MySql and Apache. This time, after doing so, session data doesn't seem to be functioning properly. I ended up breaking down and making a simplified set of code to test this, but I'm drawing a blank.

Here is test1.php:

error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
$_SESSION['test'] = "testsuccessful";
header("location: test2.php");
exit();

Output while header is commented out - Array ( [test] => testsuccessful )

Here is test2.php:

error_reporting(E_ALL);
ini_set('display_errors', 1);
session_start();
print_r($_SESSION);

Output: Array ( )

If I comment out the header line from test1.php and past in print_r($_SESSION), I get the expected array data for the session. However, when I permit it to use header to send me to test2.php, the session information is gone.

I do have devtools on Firefox running. When I look at the storage data in devtools, it says I have "No Data present for selected host". Though, in all honesty, I'm not sure what I should be seeing if this was working correctly.

I've confirmed configurations in php.ini based on the reading of some similiar questions on here, but in the end, I can't find any indication as to what is going on here. Any advice or directions?

Edit:

Added in error_reporting(E_ALL); and ini_set('display_errors', 1); Nothing appears to have changed that I can see.

1 Answers1

0

While the exact cause of this issue has not been fully determined, I did eventually identify the cause of this issue. The issue here is not related to the coding or the database configuration. Rather, the issue is because the SSL Certificate for localhost is not being recognized as verified. Without a verified Certificate, the browser will not permit the use of session information.