Second VHOST not accepting $_SESSION variable

Viewed 14

I have an apache config with 2 vhosts. Both are the same aside from different IP's and DNS entries.

I have php code which does the following.

session_start();

Later, I check for a session variable.

if (isset($_SESSION["clist"])) {

If it's NOT set, in the } else {, I read from the database, then write the results.

$_SESSION['clist'] = $records;

clist is a list of the countries and their country-codes, which I use to populate a dropdown.

When the dropdown is changed, I post the form to a handler page, then come back to the original page.

On the first VHOST, this works as intended. When I move the code to the second VHOST, the conditional tests false, so I go through the same process of pulling data from the database.

I did a little debug test with:

var_dump($_SESSION);

When I look at the dump, the first thing I see at the top is:

array(1) {
  ["clist"]=>

Is there something else that may be causing this issue?

0 Answers
Related