php cookie ssl

how do I pass a cookie across a site going from regular to ssl?
jackjohnson44Asked:
Who is Participating?
 
www-i-p-muCommented:
yes cookie are visible either regular or ssl site

but you will need to get the cookie. :)

0
 
www-i-p-muCommented:
<?php

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

?>
0
 
jackjohnson44Author Commented:
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?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.