jyushinx Posted February 9, 2007 Share Posted February 9, 2007 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? Quote Link to comment Share on other sites More sharing options...
camdagr81 Posted February 9, 2007 Share Posted February 9, 2007 I'm not sure about this, but i think the browser's (firefox) cookie settings superceed the cookie expiration. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 How are you checking the cookie expiration time? I mean, what makes you say they're different times? Quote Link to comment Share on other sites More sharing options...
jyushinx Posted February 9, 2007 Author Share Posted February 9, 2007 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, Quote Link to comment Share on other sites More sharing options...
jyushinx Posted February 9, 2007 Author Share Posted February 9, 2007 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. Quote Link to comment Share on other sites More sharing options...
Jessica Posted February 9, 2007 Share Posted February 9, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.