Solved

php cookie ssl

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
The viewer will learn how to dynamically set the form action using jQuery.
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.

747 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

13 Experts available now in Live!

Get 1:1 Help Now