Re: cookie + ie5
| From: | Brian Clark | Date: | Fri, 15 Dec 2000 08:08:08 +0000 |
| Subject: | Re: cookie + ie5 | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30470@lists.php.net to get a copy of this message | ||
Hello andre,
(a == "andre") viva@mcnon.com writes:
a> BUT sometimes in IE5 the cookie is just not set at all
a> (yes on the same station where it works well other times )
Try adding the domain argument to setcookie() and see if it works.
Check the docs for setcookie().
a> strange but true
Tony mentioned:
>> Really? The PHP manual suggests that that's a completely acceptible way to
>> create cookies... see
>> http://php.net/manual/function.setcookie.php
>>
>> Otherwise, it seems to work for me...
>>
>> One thing though,
>> str_replace(".","",$REMOTE_ADDR) + "renePR"
>> probably doesn't have the behavior you'd expect. "renePR" is typecasted
>> to
>> an int because of the + and it ends up being 0. Try replacing it with
a> this:
>> str_replace(".","",$REMOTE_ADDR) . "renePR"
>>
>> Toby Butzon
>> [ criticism spurs improvement ]
Richard responded:
>> : Because [ and ] are not valid characters in a Cookie name.
>> :
Andre asked:
>> : hi,
>> :
>> : can someone tell me why this cookie isnt set in ie 5
>> :
>> :
>> : =======================================
>> :
>> : <?
>> : if($myName && $myCode) {
>> :
>> : $myLoginOK=0;
>> : if ((trim($myName) == "rene") && (trim($myCode) == "rs#t2"))
>> : {$myLoginOK=1;};
>> :
>> : if ($myLoginOK == 1) {
>> : // md5en der ip + "renePR"
>> : $iceberg_temp = md5(str_replace(".","",$REMOTE_ADDR) +
>> "renePR");
>> : setcookie("myTicket[myICEBERG]",$iceberg_temp,time()+600,"/");
>> : echo "<html><head><title>VIVA - Online</title>";
>> : echo "<meta http-equiv=\"refresh\"
>> content=\"0;URL=doaz.php3\">";
>> : echo "</head>";
>> : echo "<body bgcolor=\"#FFFFFF\" >";
>> : }
>> : else {
>> : echo "<html><title>VIVA - Online</title>";
>> : echo "<body bgcolor=\"#FFFFFF\" >";
>> : include("no_login.tpl");
>> : }
>> : } else
>> :
>> :
>> : echo "<html><title>VIVA - Online</title>";
>> : echo "<body bgcolor=\"#FFFFFF\" >";
>> :
>> : include ("login.tpl");
>> : }
>> :
>> : echo "</body></html>";
>> :
>> : ?>
>> :
>> : ==============================================
>> :
>> :
>> : its working fine with netscape all versions
>> :
>> : its working fine from a apache server on a redhat 6.2 box
>> :
>> : but its strange on a cobald raq3
>> :
>> :
>> : any ideas ?
-Brian
--
It is easier to change the specification to
fit the program than vice versa.