two problems with cookie set


#1

Hi all, I’m getting some weird problems settings cookies via my local server (testing server) on my machine. It’s the PHP build from apachefriends.de

First of all, the cookies never ever appear in the cookies folder where all the other cookies go. It simply doesn’t turn up, yet it is evidently there because the php scripts can find it.

Secondly, and this is a new one, they only seem to exist so long as the browser window is open. I thought it was only session vars that died when browsers were closed… this cookie has an expiry value of 999999999999 so it should stay for a long time.

Any ideas on this? Thanks in advance.


#2

I am not sure what is going on, but it could be because of the time setup.

Try this…This is a cookie I use and works just modify to your use. Keep the time the same. It is set to stay for many weeks.

At least you can see if it is just your code or if it is something else.
That cookie is set to be used on all subdomains as well.
[php]<?
setcookie(“poll”,"$current_id",time()+(606024*60),"/",".your_domain.com",0);
?>[/php]


#3

Try this in IE and Netscape. I’ve noticed that certain versions of IE as well how you set them can bunk up in IE. Also, I had a MAJOR headache with cookies in IE until I added a root folder to them, i.e.:

Didn’t work:
setcookie(“cookie”,“value”, time()+36000);

Worked:
setcookie(“cookie”, “value”, time()+36000, “/”);