Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81498 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55397 invoked from network); 31 Jan 2015 20:00:25 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jan 2015 20:00:25 -0000 Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.216.169 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.216.169 mail-qc0-f169.google.com Received: from [209.85.216.169] ([209.85.216.169:60378] helo=mail-qc0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0C/52-39884-8543DC45 for ; Sat, 31 Jan 2015 15:00:24 -0500 Received: by mail-qc0-f169.google.com with SMTP id b13so25276530qcw.0 for ; Sat, 31 Jan 2015 12:00:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=AgP6qQuhc5XLXyXpfYzLYm3ewLi3Xe+TexiMtkdPKUg=; b=zHADV5TZoXjp6YK7opikZNOqzBp2+6xs2UPrmXHI3mGvMJvfGkIwucxde7DG4HMtSK oQxWwEF6SdGYy+0MFZAknhBQdsQjG40TPntmioCwLtMJCr5nlD5BqY3kzBKssRXBVekD 95kEm8lMrnHIDf4PEbSwKhE0TvKTR/K6vceapUpeJzRBiDaimZuxtYyvpXqBKIua2lH/ A79xNFOuu6qAIL97PV9y4twkrHjPWh/tbuibOTTHY6tj/wP69F0irbpvAGLLNMBumnX6 Z/wh0NhrZxlT1t0+HFGCWXFbjfryulEzQWlP1ZXUfX+HlmdNzlaYP5DdjKy5LvXgXZj/ dyLA== X-Received: by 10.140.20.226 with SMTP id 89mr24708402qgj.43.1422734421030; Sat, 31 Jan 2015 12:00:21 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.229.93.70 with HTTP; Sat, 31 Jan 2015 11:59:40 -0800 (PST) In-Reply-To: References: <46440117-42C7-40DD-8504-4EE938385050@tobin.nl> Date: Sun, 1 Feb 2015 04:59:40 +0900 X-Google-Sender-Auth: 7zTZ-fMGvMSRBDAxaiK7fUUrZGk Message-ID: To: Leigh Cc: Bas van Beek , Markus Amalthea Magnuson , "internals@lists.php.net" , sas@php.net Content-Type: multipart/alternative; boundary=001a11c1257ec67ef5050df82bf5 Subject: Re: [PHP-DEV] Why does session.gc_maxlifetime default to 1440 seconds? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --001a11c1257ec67ef5050df82bf5 Content-Type: text/plain; charset=UTF-8 Hi Leigh, On Sat, Jan 31, 2015 at 8:24 PM, Leigh wrote: > On 31 January 2015 at 11:12, Bas van Beek wrote: > > > > Well the number 1440 itself is not so arbitrary as it's the amount of > minutes in a day. Maybe that's why the number popped up. > > > > In the end 24 minutes does seem to be fine for the majority of people > and with people that care about session duration it's really easy to update > :) > > > > I like the idea of this being a 15+ year old "bug" where minutes were > used instead of seconds :) session.cache_expire? It's minutes. Do you mean session.cache_expire should be seconds? session.gc_maxlifetime is second. files/mm take it as seconds. mod_files.c - master 295 /* check whether its last access was more than maxlifet ago */ 296 if (VCWD_STAT(buf, &sbuf) == 0 && 297 (now - sbuf.st_mtime) > maxlifetime) { 298 VCWD_UNLINK(buf); 299 nrdels++; mod_mm.c - master 458 limit -= maxlifetime; 459 460 mm_lock(data->mm, MM_LOCK_RW); 461 462 ehash = data->hash + data->hash_max + 1; 463 for (ohash = data->hash; ohash < ehash; ohash++) { 464 for (sd = *ohash; sd; sd = next) { 465 next = sd->next; 466 if (sd->ctime < limit) { 467 ps_mm_debug(("purging %s\n", sd->key)); 468 ps_sd_destroy(data, sd); 469 (*nrdels)++; 470 } 471 } 472 } Current session module does not keeping last update time and relayed on probability based GC solely. gc_maxlifetime value does not have precise meaning. I proposed precise session data deletion in other thread. The same can be done for precise session data expiration. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --001a11c1257ec67ef5050df82bf5--