ID:               31652
 Updated by:       [EMAIL PROTECTED]
 Reported By:      richkerr at disabilitysoft dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         Output Control
 Operating System: Win98
 PHP Version:      4.3.10
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.

Your script is not complete.



Previous Comments:
------------------------------------------------------------------------

[2005-01-22 07:52:08] richkerr at disabilitysoft dot com

Description:
------------
Followed basic instruction in php documentation for setting cookies. 
Gave in to standards compliant browsers only, but with code below,
cookies work in  IE6.0 and Opera but not in Netscape 7.1 or Firefox
1.0.

Adding the path, domain, and secure using code identical to Manual
causes it to fail in IE as well.  Would be nice if this basic function
would work for all standards complaint browsers?

Page uses ob_start(), session_start() and no header output before call
to SetMyCookie.

Server is Apache 1.3.33 (Unix).


Reproduce code:
---------------
Function SetMyCookie($db, $login, $pwd){
        
        
if ($db == ""  and $login == "" and $pwd == ""){
setcookie("login", "", time() - 3600);//fails in netscape
setcookie("password", "", time() - 3600);
setcookie("db", "", time() - 3600);
}else{
setcookie ("login", $login, time() + 60*60*24*1800);
setcookie ("password", $pwd, time() + 60*60*24*1800);
setcookie ("db", $db, time() + 60*60*24*1800);
}



}


Expected result:
----------------
Three cookies are set with name login, password, db and values $db,
$login, and $pwd set to expire in 1800 days.  Cookies visible in the
current domain folder.

If SetMyCookie is called with empty params, then cookies, with name
login, password, and db are deleted from current domain folder.

Actual result:
--------------
Cookies not set or deleted in Gecko based browsers.


------------------------------------------------------------------------


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

Reply via email to