Solved

php cookie ssl

Posted on 2006-11-14
3
473 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calculate values in an array 18 33
Passing variables to stored procedure 3 35
wamp versus xampp 4 44
Configuring a checkbox in CSS and php 18 31
This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

911 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

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now