jackjohnson44
asked on
php cookie ssl
how do I pass a cookie across a site going from regular to ssl?
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if($_SERVER["HTTPS"] != "on") {
$newurl = "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
setcookie("cookie name", "cookie value", time() + (86400*365));
header("Location: $newurl");
}
?>