Solved

php cookie ssl

Posted on 2006-11-14
3
475 Views
Last Modified: 2006-11-20
how do I pass a cookie across a site going from regular to ssl?
0
Comment
Question by:jackjohnson44
  • 2
3 Comments
 
LVL 3

Expert Comment

by:www-i-p-mu
ID: 17943631
<?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
 

Author Comment

by:jackjohnson44
ID: 17966288
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
 
LVL 3

Accepted Solution

by:
www-i-p-mu earned 500 total points
ID: 17976837
yes cookie are visible either regular or ssl site

but you will need to get the cookie. :)

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question