Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

php cookie ssl

how do I pass a cookie across a site going from regular to ssl?
Avatar of www-i-p-mu
www-i-p-mu

<?php

if($_SERVER["HTTPS"] != "on") {
      $newurl = "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
      setcookie("cookie name", "cookie value", time() + (86400*365));
      header("Location: $newurl");
      }

?>
Avatar of jackjohnson44

ASKER

I don't get what you are saying here.
You are setting a cookie, then redirecting.
I already have a cookie set and am not worried about redirecting.

I am worndering if they will show up on either side.

Are you saying a cookie will be visible on either ssl or the regular side without doing anything?
ASKER CERTIFIED SOLUTION
Avatar of www-i-p-mu
www-i-p-mu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial