We have a plugin that relies on $_SESSION variables. It is not working. We have set up a simple test to set the variable with set_session.php
<?php
session_start();
$_SESSION['test_variable'] = 'Testing Session Success!';
echo 'Session variable set.';
?>
Then get the variable get_session.php
<?php
session_start();
if (isset($_SESSION['test_variable'])) {
echo 'Session variable value: ' . $_SESSION['test_variable'];
} else {
echo 'Session variable not set.';
}
?>
The result is when calling the get_session.php is "session variable is not set". Hostinger has said they cannot help, we need to work it out. This function works on countless other hosting providers, and was working prior to our transition to hostinger. I have done vanilla WP installs, and still no luck.
Surely this is a setting/permission issue on their end? I am baffled they have washed their hands and said they cannot help. Our session support is enable, so I am unsure what else to do, other than migrate to a hosting provider that does work. enter image description here
Any insights would be amazing!
- Specifically debugging the non working plugin did plugin clash and theme tests.
- Installed plugin on new vanilla install on Hostinger - did not work
- Created test php functions to see if session variable is being set and retained on hostinger - did not work
- Installed plugin on another hosting provider website with same PHP and WP install - worked
- Used test php functions on another hosting provider website to see if sessions set and retained - worked