Cookie problem since Upgrade to PHP4
| From: | Samantha Savvakis | Date: | Wed, 06 Sep 2000 05:25:13 +0000 |
| Subject: | Cookie problem since Upgrade to PHP4 | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-15442@lists.php.net to get a copy of this message | ||
Hi all,
I've been running php3 pages now for around 6 months. I haven't changed any
of the code, but now have upgraded my test server to php4 today. Since that,
I have not been able to read the cookies like I usually do from
$HTTP_COOKIE_VARS["cookiename"].
All my code was working under php3 and now isn't with php4.
My configure options with php4 was:
./configure'
--with-mysql=../mysql-3.23.18-alpha-pc-sco3.2v5.0.5-i386
--with-apache=../apache_1.3.11
--enable-track-vars
--with-xml
When I do a print statement, just simply printing out
$HTTP_COOKIE_VARS["whatever"], the cookies are empty "".
If I type: javascript:alert(document.cookie); into the Address of the
browser, all the cookies are there.
I did a phpinfo(), and all the cookies are set:
Apache Environment Variable:
HTTP_COOKIE: browsertype=IE;
username=samsa;
clientaccno=Q00200134;
sessionid=fe21e8df835dd5f2d55d6a46cd492c85
HTTP HEADER INFORMATION:
Cookie browsertype=IE;
username=samsa;
clientaccno=Q00200134;
sessionid=fe21e8df835dd5f2d55d6a46cd492c85
PHP Variable:
HTTP_ENV_VARS["HTTP_COOKIE"]
browsertype=IE;
username=samsa;
clientaccno=Q00200134;
sessionid=fe21e8df835dd5f2d55d6a46cd492c85
All the cookies are clearly there, so how come $HTTP_COOKIE_VARS isn't
reading it?
The line I use to set the cookie is:
setcookie("username", $data[0], 0, "/", "testserver.bris.cfs")
I just noticed that there is another PHP Variable called: HTTP_SERVER_VARS -
has someone changed HTTP_COOKIE_VARS to HTTP_SERVER_VARS?? When I change all
my calls from HTTP_COOKIE_VARS to HTTP_SERVER_VARS, it is successfully
reading the cookies. But this means updating alot of pages.
ahhh.. anyone got an answer to this?
Sam