Jump to content

Cookie Expiration Problem with IE7


jyushinx

Recommended Posts

Hi,

 

I'm running into a problem when setting a cookie in IE7.

 

The function I am using:  setcookie("COOKIENAME","COOKIEVALUE", time()+1800);

 

When I run the page which contains this function on Firefox, the cookies' expiration is set correctly; 30 minutes ahead.

 

When I run the same page in IE7, the expiration sets itself as 5 hours and 30 minutes ahead.

 

I'm not sure what this issue could be.

 

Any ideas?

Link to comment
https://forums.phpfreaks.com/topic/37772-cookie-expiration-problem-with-ie7/
Share on other sites

I have my cookie settings set to Prompt, so I receive a warning when either FireFox or IE attempts to set a cookie.

 

When the warning for the cookie pops up, you can click details or more, and see the information about the cookie; name, value, and expiration.

 

It explicitly states Expiration and as I said, for Firefox it is the proper 30 minutes and for firefox, it is 5 hours and 30 minutes.

 

Thanks,

I made a little script to show you what I mean.

 

Set your browser to prompt for cookies and you can inspect the expiration time when you are prompted.

 

http://www.pcxboston.com/cookie_test.php

 

Note how the time() function displays the same value on the page of both IE and FireFox. This means it has to do with how IE is handling the cookie. I can't understand why it would be doing what it is doing though.

 

Thanks.

I don't know, but is your computer time set to the server's time? Perhaps if they're different Firefox somehow knows that you mean 30 minutes, but IE thinks you mean that time, which is different from your computer.

 

No idea how to fix it, best of luck.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.