[PHP-DEV] Bug #15441 Updated: Cookie is set to %00 instead of erased

2002-02-08 Thread paul . lists

 ID:   15441
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Feedback
+Status:   Open
-Bug Type: HTTP related
+Bug Type: Documentation problem
 Operating System: Solaris 7
 PHP Version:  4.1.1
 New Comment:

On the documentation page it says:

When deleting a cookie you should assure that the 
expiration date is in
the past, to trigger the removal mechanism in your 
browser.

However, since the first delete cookie example doesn't have 
any value for the expire argument, it is implied that if 
called with only the variable name, PHP will automatically 
assure that the expiration date is in the past.

The code you provided works, of course.  There is 
definately a difference in the way that PHP 4.1.x handles 
this than previous versions.

I guess this is now a documentation problem. From the 
setcookie documentation, under setcookie() delete examples, 
the first listed is:

setcookie (TestCookie);

Which in PHP 4.1.x just sets the cookie to %00 as the 
original bug stated.  I suggest removing that example.

Also the function definition should no longer suggest that 
setcookie only requires one argument.




Previous Comments:


[2002-02-08 00:51:59] [EMAIL PROTECTED]

From the setcookie page.

When deleting a cookie you should assure that the expiration date is
in the past, to trigger the removal mechanism in your browser.

Try this
setcookie($username_cookie, '', time()-3600);

-Chris




[2002-02-08 00:26:56] [EMAIL PROTECTED]

Using PHP 4.1.x, the following code, which is intended to 
delete a cookie, instead replaces the value with %00 (ascii 
entity null?)

Cookies are set with the following:

setcookie($username_cookie,'username');
setcookie($password_cookie,md5('password'));

Cookies are deleted with the following:

setcookie($username_cookie);
setcookie($password_cookie);

Yes, the $username_cookie and $password_cookie variables 
have values.

The above is case (a) in the documentation, the simplest 
case.

I've tried this on all the systems I have access to.

Affected: 
Solaris 7, PHP 4.1.0
Red Hat 7.1, PHP 4.1.1

Not Affected: 
Red Hat 7.1, PHP 4.04pl1
Mac OS X 10.1.2, PHP 4.0.6
Solaris 7, PHP 4.06

One affected system that I've used is on a web host 
(communitech.net, who just very recently moved to PHP 4.1.0 
from 3.0.9, Solaris 7).  The other is on the freshly setup 
intranet server at my employer (Linux 4.1.1).

Here's the configuration line (Solaris 7, PHP 4.1.0):

 './configure' '--with-mysql=/usr/local/mysql' '--with-
curl=/root/src/curl/curl-7.9.3' '--with-xml' '--with-
apache=/root/src/apache/apache-fp_1.3.3'

And the one from Red Hat 7, PHP 4.1.1:

'./configure' '--prefix=/usr/local' '--with-apache=/usr/
local/src/apache/Apachetoolbox-1.5.50/apache_1.3.22' '--
enable-exif' '--enable-track-vars' '--with-calendar=shared' 
'--enable-safe-mode' '--enable-magic-quotes' '--enable-
trans-sid' '--enable-wddx' '--enable-ftp' '--with-gd=/usr/
local' '--with-zlib' '--enable-gd-native-tt' '--with-t1lib=
/usr/local' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '-
-with-zlib-dir=/usr' '--with-ttf' '--with-freetype-dir=/
usr' '--with-imap=/usr/local' '--with-openssl=/usr' '--
with-mysql=/usr/local/mysql' '--with-pgsql' '--with-ldap'

The same code works in previous versions of PHP to 4.1, as 
indicated above.  I've tried the code in three different 
browsers so I don't think it is browser dependent.

The actual piece of code is part of a larger system.  I can 
give you the code or access to one of the servers if 
necessary.

Thanks in advance.

Paul Burney
Webmaster
Concord Consortium and UCLA GSEIS





-- 
Edit this bug report at http://bugs.php.net/?id=15441edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Bug #15441 Updated: Cookie is set to %00 instead of erased

2002-02-08 Thread cnewbill

 ID:   15441
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Open
+Status:   Closed
 Bug Type: Documentation problem
 Operating System: Solaris 7
 PHP Version:  4.1.1
 New Comment:

This bug has been fixed in CVS.


Previous Comments:


[2002-02-08 10:00:26] [EMAIL PROTECTED]

On the documentation page it says:

When deleting a cookie you should assure that the 
expiration date is in
the past, to trigger the removal mechanism in your 
browser.

However, since the first delete cookie example doesn't have 
any value for the expire argument, it is implied that if 
called with only the variable name, PHP will automatically 
assure that the expiration date is in the past.

The code you provided works, of course.  There is 
definately a difference in the way that PHP 4.1.x handles 
this than previous versions.

I guess this is now a documentation problem. From the 
setcookie documentation, under setcookie() delete examples, 
the first listed is:

setcookie (TestCookie);

Which in PHP 4.1.x just sets the cookie to %00 as the 
original bug stated.  I suggest removing that example.

Also the function definition should no longer suggest that 
setcookie only requires one argument.





[2002-02-08 00:51:59] [EMAIL PROTECTED]

From the setcookie page.

When deleting a cookie you should assure that the expiration date is
in the past, to trigger the removal mechanism in your browser.

Try this
setcookie($username_cookie, '', time()-3600);

-Chris




[2002-02-08 00:26:56] [EMAIL PROTECTED]

Using PHP 4.1.x, the following code, which is intended to 
delete a cookie, instead replaces the value with %00 (ascii 
entity null?)

Cookies are set with the following:

setcookie($username_cookie,'username');
setcookie($password_cookie,md5('password'));

Cookies are deleted with the following:

setcookie($username_cookie);
setcookie($password_cookie);

Yes, the $username_cookie and $password_cookie variables 
have values.

The above is case (a) in the documentation, the simplest 
case.

I've tried this on all the systems I have access to.

Affected: 
Solaris 7, PHP 4.1.0
Red Hat 7.1, PHP 4.1.1

Not Affected: 
Red Hat 7.1, PHP 4.04pl1
Mac OS X 10.1.2, PHP 4.0.6
Solaris 7, PHP 4.06

One affected system that I've used is on a web host 
(communitech.net, who just very recently moved to PHP 4.1.0 
from 3.0.9, Solaris 7).  The other is on the freshly setup 
intranet server at my employer (Linux 4.1.1).

Here's the configuration line (Solaris 7, PHP 4.1.0):

 './configure' '--with-mysql=/usr/local/mysql' '--with-
curl=/root/src/curl/curl-7.9.3' '--with-xml' '--with-
apache=/root/src/apache/apache-fp_1.3.3'

And the one from Red Hat 7, PHP 4.1.1:

'./configure' '--prefix=/usr/local' '--with-apache=/usr/
local/src/apache/Apachetoolbox-1.5.50/apache_1.3.22' '--
enable-exif' '--enable-track-vars' '--with-calendar=shared' 
'--enable-safe-mode' '--enable-magic-quotes' '--enable-
trans-sid' '--enable-wddx' '--enable-ftp' '--with-gd=/usr/
local' '--with-zlib' '--enable-gd-native-tt' '--with-t1lib=
/usr/local' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '-
-with-zlib-dir=/usr' '--with-ttf' '--with-freetype-dir=/
usr' '--with-imap=/usr/local' '--with-openssl=/usr' '--
with-mysql=/usr/local/mysql' '--with-pgsql' '--with-ldap'

The same code works in previous versions of PHP to 4.1, as 
indicated above.  I've tried the code in three different 
browsers so I don't think it is browser dependent.

The actual piece of code is part of a larger system.  I can 
give you the code or access to one of the servers if 
necessary.

Thanks in advance.

Paul Burney
Webmaster
Concord Consortium and UCLA GSEIS





-- 
Edit this bug report at http://bugs.php.net/?id=15441edit=1


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php