PDA

View Full Version : Cookies across different ports


isleshocky77
05-18-2003, 05:09 PM
I am currently using cookies to hold items in a shopping cart. However when a user switches from the regular pages, http://www.domainname.com to a secure page https://www.domainname.com the information is lost because they are different cookies. Is there a way to have it read from the same cookie? All my code is in php. Any help would be greatly appreciated. Thanks.

whackaxe
05-18-2003, 06:38 PM
i think you would have to use the domain argument in setcookie();


$value
setcookie("username", $value, time()+3600, "/", "www.domainname.com");


i just read that of the PHP.net manual but havent actually tested it: http://www.php.net/manual/en/function.setcookie.php