On Sat, 2006-06-24 at 10:51, John Meyer wrote: > tedd wrote: > > At 6:26 PM -0400 6/23/06, Tom Ray [Lists] wrote: > >> I've run into something rather odd with cookies today. I'm working with this admin section on a site and I'm setting a cookie that is supposed to be good for one hour. So in the cookie I have time()+3600 and all was well or that was until someone fired up IE. It seems that IE refused to set the cookie. After much swearing at IE, I found that if I set it to time()+7200 the cookie would be set. > >> > >> Not if that wasn't odd enough, in Firefox if I logged in at 6PM the cookie said it would expire at 8PM which is correct. However, when I logged in via IE at 6PM it said the cookie would expire at 23:00 hours (11PM for those who don't know)...so my question is...why is this happening and why does IE do this? I checked in Opera, Mozilla and Netscape and they all work the same as Firefox..... > > > > You answered the question yourself, you're testing IE. It sounds like M$ is trying to make time to adapt to their standard. > > > > But, you're not alone -- try Google with "IE cookies expiration" > > > > tedd > BTW, I have a question: which is the preferred way to handle variables > on the client side: cookies or sessions? Or are there situations where > one should be used and the other should be used in these other situations. Ummm, how are you implementings sessions? Usually it's done by cookies... or with trans_sid. Either way you shouldn't really be making a distinction here. Unless of course you mean literally storing the data in the client side cookie, versus storing a unique ID there that maps to something in your database or filesystem... in which case go for the latter, but make sure your ID is long enough and random enough to be secure. Usiong PHP's built in session stuff usually works quite well and saves you needing to do the low level work of linking up the cookie with the data. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `------------------------------------------------------------' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php