For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > February 2007 > cookies... IE7 won't set them









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cookies... IE7 won't set them
Kees

2007-02-03, 6:59 pm

I got this code (snippet of my site). I expect cookies to be set. But no.
Sometimes (!) it works, but them retsrt IE7 and... again no! Any ideas? I'm
pretty sick of it. It just sticks to value 'nl'.

FFox does it exactly the way I expect it to behave. And don;t tell me to use
Ffox. I use it. But other people need to read my site too ;-)

Just to be sure the cache won't hurt I added the time(). Output is below.

Thanks in advance, I hope somebody has a good idea!
Kees
_________

<?php
function br()
{
return "<br/>";
}
function a($a,$b)
{
return "<a href=\"$a\">$b</a>";
}
setcookie("language","$newlang",time()+52*604800,"/start/",www.mysite.com);
echo time();
echo "<pre>";
print_r($_COOKIE);
echo "</pre>";
echo a("ff3?newlang=nl","NL").br();
echo a("ff3?newlang=en","EN").br();
echo a("ff3?newlang=de","DE").br();
echo a("ff3?newlang=fr","FR").br();
echo a("ff3?newlang=es","ES").br();
?>
_____________
1170546628
Array
(
[language] => nl
[__utma] => 123799051.2061183218.1164095489.1164095489.1164095489.1
[__utmz] =>
123799051.1164095489.1.1. utmccn=(direct)|utmcsr=(direct)|utmcmd=(
none)
)
NL
EN
DE
FR
ES


Kees

2007-02-03, 6:59 pm

Seems to me, after some more research, that I must use:

setcookie("language","$newlang",time()+52*604800,"/start/",.mysite.com,0);
instead of
setcookie("language","$newlang",time()+52*604800,"/start/",www.mysite.com);

Any additions welcome!
Kees
____________

"Kees" <news2@poi66.com> wrote in message
news:45c520cc$0$55385$dbd4b001@news.wanadoo.nl...
>I got this code (snippet of my site). I expect cookies to be set. But no.
>Sometimes (!) it works, but them retsrt IE7 and... again no! Any ideas? I'm
>pretty sick of it. It just sticks to value 'nl'.


[...]


Gernot Frisch

2007-02-15, 6:59 pm


"Kees" <news2@poi66.com> schrieb im Newsbeitrag
news:45c525b2$0$52539$dbd4b001@news.wanadoo.nl...
> Seems to me, after some more research, that I must use:
>
> setcookie("language","$newlang",time()+52*604800,"/start/",.mysite.com,0);
> instead of
> setcookie("language","$newlang",time()+52*604800,"/start/",www.mysite.com);


uhm... www.mysite.com without qoutes??


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com