Cookie set on HTTPs usable on HTTP?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rxsid
Forum Commoner
Posts: 82
Joined: Thu Aug 29, 2002 12:04 am

Cookie set on HTTPs usable on HTTP?

Post by rxsid »

Hi all,

I'm trying to set a cookie on a https url, then meta refresh to a http url and have that cookie work on the http pages...but it's not working. here's what i've got:

Code: Select all

$cookieDuration = time() + 3600;
$whichPath = "/";
$whichDomain = ".somesite.com";
setcookie ("const", "var",$cookieDuration,$whichPath,$whichDomain);
if i set the last parm to 1, then the cookie is only "usable" on a secure path....right?
Post Reply