PHP session management broken even though it works in 3 other environments

I have a large PHP app that’s been working for YEARS, it worked in an Apache/cPanel/Mysql hosted local data center, it worked in Docker with the standard docker images, and in a few other places over the years.

Now, it appears that my $_SESSION variables aren’t being preserved between page flips. It’s not me doing it, I’ve thoroughly debugged the code and the $_SESSION variables are definitely not being preserved between page flips.

What is the problem here? Is there something in the php.ini I need to pay attention to? Right now I’m running in the AWS cloud with the standard Bitnami (VMWare) distribution which contains Apache and MySql, so it should be a pretty identical environment to what I was using before. The pages are being served, and PHP appears to be working fine (once I get inside the page it’s all good). However all the $_SESSION variables are getting clobbered between page flips.

Is there another way to determine the current session ID? It looks like “something” is regenerating my session ID with every page flip. If I call session_id() as the very first line of code at the top of the page, I get a 0. Subsequently then, my logic says “gee, I have no session ID, I better go create one”, and then it calls session_start and after that everything is fine, I can get into the page and everything works as it should “while” the page is being displayed.

I was expecting this to behave in exactly the same way as the previous incarnations of the app, but apparently there’s something different somewhere, and I have no idea where to look. Any and all help is greatly appreciated!