PDA

View Full Version : Php Setcookie, Why Would Server Time Zone Matter?


NHFTRich
09-28-2004, 12:51 AM
ok, this is very strange.

one of my scripts sets a cookie with a one hour expiration.

This has worked for a while now.

One of my users said he was having problems.

I looked and yes, I'm having problems too. MS IE would not work correctly (the cookie was not being set), but netscape navigator worked perfectly.

I checked everything and I finally found that the server time zone seems to be off.

I can see that by using WS_FTP time offset. By sending a file and seeing it's creation time, I can then adjust the offset to match the known write time.

For some reason my server is offset 3 hours now, instead of the 5 it should be from GMT, we are on the east coast, no?

So why would MS IE care about the server time zone, were navigator would not when setting a cookie expiration time.

Does anyone have a good fix for this?

i'm talking about code like:

setcookie ('mycookie', $cookie_data, time()+3600);

as a crazy work around I had to change this to:

setcookie ('mycookie', $cookie_data, time()+6600);

:huh:

Does anyone have any ideas how to make this work without being time zone dependent on MS IE?

And who changed the damn time zone on www18!!!!