I would greatly appreciate any advice on how to preserve my php session variables once i do a https redirect like this:
$location = 'https://' . BASE_URL . 'billing.php';
header("Location: $location");
exit();
I would greatly appreciate any advice on how to preserve my php session variables once i do a https redirect like this:
$location = 'https://' . BASE_URL . 'billing.php';
header("Location: $location");
exit();
What you're looking for is session_set_cookie_params().
Make sure the domain
parameter is like: .yoursite.com
with a dot at the beginning and that will make it match for any subdomains of yoursite.com.
Then make sure the secure
parameter is set to true
, which will allow it to be sent over a secure connection.
You can view your current configuration with session_get_cookie_params().