I developed a basic web application as an exercise to learn php. I completed the application on a first webhost (with php 5.4.38 installed) but had to switch to another one afterwards (with php 5.5.30 installed). The code was working fine with the first webhost but once I switched to the other one things fell apart because every time the code tried to retrieve data from a session variable previously set in another file the value returned was empty.
In particular, I am able to retrieve data from the session variable in the html file that is included just after the php file where the session was set. However, once I try to navigate through the site from there, the session variable is empty.
I checked the php.ini of both webhosts and I found some differences in the session variables configuration. I looked on the web for solutions and tried to implement them but, so far, unsuccessfully. I tried to modify the session's config in the second php.ini but that didn't work either.
As you can see (from the two hyperlinks provided below), the "Registered save handlers" are partially different: on the second host the "memcache" handler is missing (I read on the internet about the possibility to store sessions either in memcache or in a database but to be honest it is way too technical for me given my current knowledge of php).
The "Registered serializer handlers" are also partially different, in the first host's config they are "php php_binary wddx" while in the second one's they are "php_serialize php php_binary wddx".
Besides from the save handlers, the second host also has some "entropy" settings, which the first one doesn't have. Also, the first host has the "force_path" setting set to "1" while the setting doesn't appear in the second host's file. Also, the first host has "gc_probability" set to "0" while the second one has it set to "1". Furthermore, the first host has no "use_strict_mode" setting while the second one has it set to "Off". Finally, the first host has "use_trans_sid" setting set to "1" while the second host has it set to "0".
My best guess is that the problem lies in the absence of "memcache" has a save handler in the second webhost's php.ini file, however, I have no clue about how to fix it.
Please find attached the relevant portion of the two php.ini, if you need the rest of the php.ini or more info let me know.
First host php.ini config Second host php.ini config
Edit: I tried to comment out the session entropy settings on the second php.ini but this did not solve the problem.
Thanks in advance,
M.C.