Jump to content

cookies are 2 minutes off in IE (with setcookie)


nujai

Recommended Posts

???

I've been searching for information about this to no avail.

 

I'm testing pages using cookies set with setcookie.  I suddenly started experiencing failures in IE.

But Firefox was still fine.

 

I noticed that it had to do with the cookie expiry time  (I have v. 7).  I had lowered the expiry threshold so I wouldn't have to keep clearing my browser cookies to test.

 

Is there some kind of minimum expiry time for IE??  Like 2 minutes...?

Does IE shave two minutes off the top?

 

Here's what I found:

 

time() + 3600 gives me 58 minutes in IE and 1 hour in Firefox

time() + 60 gives nothing I have time to notice in IE and a minute in firefox

time() + 120 gives me a couple seconds in IE and 2 min in firefox

 

Is this an IE "feature" or is it me that's doing something wrong?  I am new to this after all...

 

example of how i set the cookies:

$hour = time() + 120;

setcookie(wpsite, $_POST['username'], $hour);

 

does work for the most part, just that little issue so far....

 

If anyone knows about this, pls let me know.  I don't care whether it's fixable or not, it's just that I though I was going crazy at first when I was trying to troubleshoot the problem; could not figure out what was going on initially.

 

Thanks.

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.