You are here: Re: [PHP] set cookie function problem « PHP « IT news, forums, messages
Re: [PHP] set cookie function problem

Posted by Richard Lynch on 04/20/05 06:17

On Tue, April 19, 2005 2:20 pm, Ospinto said:
> Can someone help me with this problem?
> setcookie('myCookie',"blah");
> works fine. but when i try to set it with an expiry time, it doesn't.
> setcookie('myCookie',"blah",time()+3600);
>
> I have cookies enabled on my browser of course. And the way I know the
> second statement is not working is cos I'm doing a var_dump of $_COOKIES.
> Thanks for your help.

If the user's computer clock is way out of whack, and you are setting a
cookie to expire in 1 hour, you're likely to have problems...

Though *maybe* browsers account for this by comparing your Date: header
and your clock time, and ignore the user clock.

For sure, though, *some* versions of IE will *NOT* work when you set a
Cookie time, but not a path.

That's because the Microsoft engineers mis-read the Cookie spec (on
purpose perhaps) and require *both* time and path, or neither, but not
just path.

YMMV

--
Like Music?
http://l-i-e.com/artists.htm

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация