httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ryan Schefke" <>
Subject RE: [users@httpd] Please Help With Cookies
Date Sun, 30 May 2004 16:11:43 GMT
Hi Jeff,

You seem very helpful so let me explain in detail.  Please let me know if I
can e-mail you my "poll.php" script.  

Again, it works fine on one box and not on the other.  You can see the
version of Apache/MySQL/PHP from the files below.

Note, I REALLY want to avoid switching register_global to off since I have
100's of pages of php code written already with register_global on. All my
forms etc. use the short form of variables.  It would be brutal if I had to
redo everything. Again, it works find on the windows machine but not when I
transitioned my code to the linux box.

On working Windows Machine (cookies working):
1 - The below link contains the following code after script executed:

echo phpinfo();

On Linux Machine (cookies not working):
1 - The below link contains the following code after script executed:

echo phpinfo();

Now, what is really weird is that I can write a simple script and set/write
a cookie on the linux machine.  For example, this script,

Contains the code:
setcookie ("test2_ck", "7"); // 
setcookie ("test_ck", "10"); // 
header ('Location: phpinfo2.php');

And phpinfo2.php (where it's redirected) contains this code:
echo $test2_ck; //
echo $test_ck; //


I'M TOTALLY CONFUSED, PLEASE HELP.  My application is worthless without this

Thanks a lot,

-----Original Message-----
From: [] 
Sent: Sunday, May 30, 2004 11:18 AM
Cc: 'Ryan Schefke'; Apache Discussion List
Subject: Re: [users@httpd] Please Help With Cookies


>My code containing cookies running on windows with a working Apache and
Php installation executed all scripts containing cookies perfectly.
However, I >transitioned my code to a Linux box with a fresh install of PHP
and Apache 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.

You forgot to include the code.  What version of PHP are you running on
each machine? Are you using $_COOKIE['cookiename'] or $cookiename? if the
latter, try the former.  can you write a small script to set a cookie and
display its value on the linux box? what does var_dump($_COOKIE) show?


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message