?
Solved

php cookie ssl

Posted on 2006-11-14
3
Medium Priority
?
480 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 total points
ID: 17976837
yes cookie are visible either regular or ssl site

but you will need to get the cookie. :)

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …
Suggested Courses

771 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