RE: [PHP] cookies malfunctioning moving from windows to linux
| From: | Ryan Schefke | Date: | Sun, 30 May 2004 14:04:27 +0000 |
| Subject: | RE: [PHP] cookies malfunctioning moving from windows to linux | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187229@lists.php.net to get a copy of this message | ||
Thomas/All,
To summarize, my code containing cookies running on windows with a working
php installation (and Apache) executed all scripts containing cookies
perfectly. However, I transitioned my code to a Linux box with a fresh
install of PHP and now my cookies aren't working. Below is an example of
setting and writing cookie values from one script. Again, everything worked
like a charm on my old machine. That's why I think it has something to do
with the Apache or PHP installation settings.
Note - on the new PHP installation I've had to change the "register_global"
switch to "on" in my php.ini file to get my code working. Now the cookies
don't work...
Please, please help!
===================== SET value of cookie =============
setcookie ("showpoll_ck", "$ID"); // set cookie to show poll answers
header ('Location: '.$PHP_SELF);
===================== SET value of cookie =============
===================== WRITE value of cookie =============
<?php
echo '<p>';
if ($showpoll_ck == "$ID") {
echo '<font color="blue"><b><div align="center">Thank you
for your vote.
Results:</div></b></font>';
}
echo '</p>';
?>
===================== WRITE value of cookie =============
** PS, I also tried $_COOKIE['showpoll_ck'] when writing value...that
doesn't make a difference, that's why I think it's something with the
install.
-----Original Message-----
From: Thomas Seifert [mailto:thomas-lists@myphorum.com]
Sent: Sunday, May 30, 2004 3:43 AM
To: php-general@lists.php.net
Subject: Re: [PHP] cookies malfunctioning moving from windows to linux
Ryan Schefke wrote:
> I don't think that is it. I believe session.save_path is only for
sessions,
> not cookies. I'm only using cookies in the application.
>
> Can someone please help?
>
> Thanks,
> Ryan
Yeah, tell HOW you set the cookies.
There is really no difference in linux/windows-php in this cases.
thomas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php