Help needed: why this cookie is not working on IE?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
scheiner
Forum Newbie
Posts: 3
Joined: Fri Aug 13, 2004 7:31 am

Help needed: why this cookie is not working on IE?

Post by scheiner »

Hi All,

I have a problem setting cookies . I hope some of you will be able to help me...

look at this link:
http://www.my-robot-store.com/testcookie.php

in that link there is a cookie that its session is limited to only 3 second (the code of the script can be viewed here: http://www.my-robot-store.com/testcookie.txt)

the script increase the cookie by one, for each refresh. of course, since the cookie is limited to 3 second it should be restarted if it is not used for more than 3 second. but as you can see, you can wait few minutes, refresh and the cookie is still there (the number is increase) . The thing is that the script works fine on with Mozilla But not with Internet Explorer (the cookie is not set when using IE6) .

If any of you have any idea how to change the code in order to it to work the same for IE and Mozilla, please let me know

Tnx,
Uri
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

the likely reason why the session isn't deleted quickly is the garbage collection probability is set real low. It works fine on my IE, btw. Although I think you going to want to set the lifetime for garbage collection, instead of the cookies expire time (which is what you are setting now)
scheiner
Forum Newbie
Posts: 3
Joined: Fri Aug 13, 2004 7:31 am

Post by scheiner »

I think the reason that it is happening is the timezone difference. the time is it setting the cookie on my client is not the same as the server's time. I think you are in the same zone as the server and that is why it is working fine...,

Anyway, I'll be very interested in checking your suggestion (btw- does it explain why it works diffrence in IE and Mozilla). can you explain how to do it?

Tnx,
Uri
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'm 7 hours off from the server.. it's definitely not a timezone thing.. About the only thing that stands out a bit, is the server's time is offset from mine (when adjusted to the same timezone).. I don't think IE is setting it's internal timing clock to the server's time being reported.. so the actual death takes a little longer that's all..
scheiner
Forum Newbie
Posts: 3
Joined: Fri Aug 13, 2004 7:31 am

Post by scheiner »

ok. if so, I will check it with more patience and see if it works.

Tnx!!
Uri
Post Reply