Bug #1308: Cookie Value set in JavaScript not available in PHP
| From: | gfuelber at rrsoft dot com | Date: | Fri, 09 Apr 1999 13:29:52 +0000 |
| Subject: | Bug #1308: Cookie Value set in JavaScript not available in PHP | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-5005@lists.php.net to get a copy of this message | ||
From: gfuelber@rrsoft.com
Operating system: Linux 2.0.36
PHP version: 3.0.7
PHP Bug Type: Misbehaving function
Bug description: Cookie Value set in JavaScript not available in PHP
Hi!
I´m not sure, but i think this could probably be a bug:
I set a value of a cookie in JavaScript:
<SCRIPT language="JavaScript">
COOKIELIVEDAYS=1;
var COOKIE_DELDATE="Thu, 01-Jan-1970 00:00:00 GMT";
var COOKIE_INHALT = document.cookie.split(";");
function cookie_live() {
var date=new Date();
date.setDate(date.getDate()+COOKIELIVEDAYS);
var gmt=date.toGMTString();
var k1=gmt.indexOf(" ");
var k2=gmt.indexOf(" ", k1+1);
var k3=gmt.indexOf(" ", k2+1);
var str=gmt.substring(0,k2)+"-"+gmt.substring(k2+1,k3)+"-"+gmt.substring(k3+
3,gmt.length);
return str;
}
function set_cookie(name, value) {
document.cookie=name+"="+escape(value)+"; expires="+cookie_live();
}
</SCRIPT>
<?
.....
echo "<SCRIPT language=\"JavaScript\">
cookie = \"1\"; \n
set_cookie(\"DOUBEv\",cookie); \n
</SCRIPT>";
?>
I checked the name and value of this cookie with another JavaScript-Function: The Cookie was
available and its value was 1.
When I checked the value in PHP3 with
<?
while (list($tmpvar, $tmpvalue)=each($HTTP_COOKIE_VARS)) {
echo "$tmpvar : $tmpvalue <BR>\n"; }
?>
2 other cookies set before in PHP were available, but not the cookie set just before by the
JavaScript-Function.
Also the value of $DOUBEv in PHP3 was not available, an I think here could be a bug
Gerhard.
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net