1

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();
Mike
  • 23,542
  • 14
  • 76
  • 87

1 Answers1

1

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().

Mike
  • 23,542
  • 14
  • 76
  • 87