You are here: Re: Cookie expires at end of session « PHP Programming Language « IT news, forums, messages
Re: Cookie expires at end of session

Posted by petersprc on 12/07/06 19:30

Hi,

Setting the expiration time should do it. May want to double-check the
cookie path and domain.

You could also check if the client is overriding this behavior. For
example, Firefox has an option called "Keep Cookies until I close
Firefox" (Tools -> Options -> Privacy -> Cookies) which could interfere
with this.

T.Taylor wrote:
> I am using a session to store user info and a cookie to store their
> username. When the user returns to the site I would like the username
> to be loaded from the cookie but it expires as soon as you close the
> browser. How can I stop the cookie from expiring when the browser
> closes?
>
> setcookie($cookiename,$cookievalue,time()+(60*60*24*90),$cookiepath,$cookiedomain);
>
> Thanks in advance.

 

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

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