You are here: Re: how to keep a session variable alive across browser closings « PHP Programming Language « IT news, forums, messages
Re: how to keep a session variable alive across browser closings

Posted by laredotornado@zipmail.com on 08/20/07 20:46

On Aug 16, 4:11 pm, Rik <luiheidsgoe...@hotmail.com> wrote:
> On Thu, 16 Aug 2007 22:59:18 +0200, laredotorn...@zipmail.com
>
> <laredotorn...@zipmail.com> wrote:
> > Hi,
>
> > When a user logs into our site, we create a session variable to denote
> > the session is active and another to denote who is logged in. Once
> > the user closes the browser and re-opens it, the session is destroyed
> > and the variables are gone.
>
> > How can I keep the session alive for 24 hours even if the user closes
> > and re-opens the browser?
>
> <http://nl3.php.net/manual/en/ref.session.php>:
> Set:
> - session.gc_maxlifetime 86400
> - session.cookie_lifetime 86400
>
> A note from the manual:
> "Note: If different scripts have different values of
> session.gc_maxlifetime but share the same place for storing the session
> data then the script with the minimum value will be cleaning the data. In
> this case, use this directive together with session.save_path."
>
> ... which is the case for many shared hosts.
>
> --
> Rik Wasmus

So would I need to add

> - session.gc_maxlifetime 86400
> - session.cookie_lifetime 86400

on every page beneath the "session_start()" command?

- Dave

 

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

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