You are here: Re: [PHP] Intelligent "session_destroy()" « PHP « IT news, forums, messages
Re: [PHP] Intelligent "session_destroy()"

Posted by Ondrej Ivanič on 10/01/97 11:27

Ken Tozier wrote:
> I'm writing a bunch of scripts that will all use a common session and
> am a bit confused about when to manually destroy sessions and/or when
> php automatically destroys them for me. For example:
>
> If a user starts a session, leaves their computer on and goes home for
> the weekend, when they come back on Monday will their session still
> exist on the server? Could they pick right up where they left off?

don't care and only sets

session.gc_maxlifetime
session.gc_divisor
session.gc_probability

to correct values.

When you call session_start php sometimes runs garbage collector which
remove old sessions. Probability is calculated by using
gc_probability/gc_divisor e.g. 1/100 means there is a 1% chance that the
GC process starts on each session_start(). If you set probability to
100% GC will run on every session_start(). This is good for testing but
not for production environment (default value (1%) is enough).

Sessions which is last modified (before php 4.2.? was used last access
time) before current time minus gc_maxlifetime is a old session and will
be deleted.

--
Ondrej Ivanic
(ondrej@kmit.sk)

 

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

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