Here's the code
<?php
print_r(session_get_cookie_params());
session_set_cookie_params(3600, "/", "mydomain.com");
When I refresh the page, the above parameters are not saved
session_start();
var_dump($_SESSION);
$_SESSION['name'] = "name";
When I refresh the page, the above variable is not saved
var_dump($_SESSION);
print_r(session_get_cookie_params());
However, both variable and parameters are correctly displayed on first page load.
?>
The first var_dump ALWAYS returns an empty array, the second successfully returns the "name" within it.
$_SESSION variables only ever last one page load.
I have tried naming the session, adding a (long) timeout, linking to a different page, but $_SESSION variables only ever last one page load.
Must this be a problem with the server?