Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92169 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20634 invoked from network); 8 Apr 2016 09:54:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Apr 2016 09:54:08 -0000 Authentication-Results: pb1.pair.com smtp.mail=narf@devilix.net; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=narf@devilix.net; sender-id=pass Received-SPF: pass (pb1.pair.com: domain devilix.net designates 209.85.218.41 as permitted sender) X-PHP-List-Original-Sender: narf@devilix.net X-Host-Fingerprint: 209.85.218.41 mail-oi0-f41.google.com Received: from [209.85.218.41] ([209.85.218.41:35337] helo=mail-oi0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 96/75-25122-FBF77075 for ; Fri, 08 Apr 2016 05:54:08 -0400 Received: by mail-oi0-f41.google.com with SMTP id p188so130566252oih.2 for ; Fri, 08 Apr 2016 02:54:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=devilix.net; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=eJjjhSHqZM8Mbay7fWiJk/EFuMRq3JPJ1dFZAGs5bwU=; b=AmX9p81t/8c9HMpDGyI1Z9u11iA0KKbtro/rXrMoV7Sbi7lTs8c8dkK0o/rY9VM5uG PO/n84lap+6cbU7zrTaNzH8gmvTCjuvH5S9hQ6f7fLZzK6PI8xMCQwcVZ5m/oxfwqHT8 n+Ouj78SudYbSdTn1KUPNEcp/r11zwcrHbbPA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=eJjjhSHqZM8Mbay7fWiJk/EFuMRq3JPJ1dFZAGs5bwU=; b=CsEEkI3oOeyBYMQBCkt9BzLlFmY2JNo0m7T/mnu9R5+GaG3PSB/iCHZgTnXyiQSvUR zKz5ezFOWxZ271ZvowpKyqMtFhEJ0eGGRUlQ9bcB1jIyTpRa6DGevgBKWEMMRQtbxrxM /9Xr//BEuFHAJOQfoc+yemPB9g1+oMhtoTYezjP06uzvSt+rbY+HACTTV7emBbSOg2LQ C6Z78eTtf8Qnei/1V5Y9DeFmsu62OaU5czAM/Dd94LA7Em2iB6i6Gf+6Dnq10VrqLILu mrtoXMPvljuQD3bZBvvhhzVO6QJsTEcV6EJ65RdUX2iQn9hNGh+SteWHD5ZNZ7VvShil mgdQ== X-Gm-Message-State: AD7BkJIAxpWWxfaZPvVfEkOdSGV20nmojFlWm+KE8vgtCVcXDALh3B4ygEcRrk+76ad37Rz0QtR5dqU7erZu2w== MIME-Version: 1.0 X-Received: by 10.202.69.8 with SMTP id s8mr3810995oia.42.1460109245117; Fri, 08 Apr 2016 02:54:05 -0700 (PDT) Received: by 10.202.175.87 with HTTP; Fri, 8 Apr 2016 02:54:05 -0700 (PDT) In-Reply-To: References: Date: Fri, 8 Apr 2016 12:54:05 +0300 Message-ID: To: Yasuo Ohgaki Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=001a113dd96ae38bf0052ff62cea Subject: Re: [PHP-DEV] [RFC][Discussion] Add session_gc() From: narf@devilix.net (Andrey Andreev) --001a113dd96ae38bf0052ff62cea Content-Type: text/plain; charset=UTF-8 Hi, On Fri, Apr 8, 2016 at 12:29 PM, Yasuo Ohgaki wrote: > Hi Andrey, > > On Fri, Apr 8, 2016 at 6:20 PM, Andrey Andreev wrote: > > On Fri, Apr 8, 2016 at 11:33 AM, Yasuo Ohgaki > wrote: > >> > >> Hi Andrey, > >> > >> On Fri, Apr 8, 2016 at 4:57 PM, Andrey Andreev > wrote: > >> >> > >> >> PS(gc_maxlifetime) is needed, so I fixed the last commit. > >> >> > >> > > >> > It is necessary for probability-triggered GC because you don't have > >> > another > >> > way of giving a TTL value then, but that's not the case for a direct > >> > session_gc() call. > >> > >> PS(gc_maxlifetime) is not related directly to probability based GC, > >> but it's about which session should be deleted. > >> > >> Save handlers are supposed to delete inactive sessions exceeds > >> PS(gc_maxlifetime) when GC is issued. Save handlers are not suppose to > >> use PS(vars) directly and should use passed TTL parameter. Therefore, > >> the parameter is passed. > >> > > > > It is not directly related to gc_probability it is very obviously the > result > > gc_probability-based design. > > > > Still, even if we agree to disagree on that, it's not a blocker for > > maxlifetime being overridable via a parameter. > > We need TTL value and the TTL is gc_maxlifetime. > How would you specify session data to be removed? > > TTL value is mandatory. > I wrote this pseudo-code in my very first reply to this thread ... function session_gc($ttl = ini_get('session.gc_maxlifetime')) {} If that's unclear, here's a more verbose way to put it: function session_gc($ttl = null) { if (empty($ttl)) { $ttl = ini_get('session.gc_maxlifetime'); } // ... } It just gives the ability to override the INI value for those who don't want or need it. Cheers, Andrey. --001a113dd96ae38bf0052ff62cea--