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
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,

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.