Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92178 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67151 invoked from network); 8 Apr 2016 23:24:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 8 Apr 2016 23:24:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.66 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.213.66 mail-vk0-f66.google.com Received: from [209.85.213.66] ([209.85.213.66:36215] helo=mail-vk0-f66.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/83-35810-7CD38075 for ; Fri, 08 Apr 2016 19:24:55 -0400 Received: by mail-vk0-f66.google.com with SMTP id x190so18051147vka.3 for ; Fri, 08 Apr 2016 16:24:55 -0700 (PDT) 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; bh=VNWJlnS8D3R1qtNkWjI2gcOk+xzWeoMR0nb5d8arbug=; b=GogjyBvTKtbNBujcpKHZR41Ak1HF/b8tpwIfrxpLPouzqLxLeW5ZLvd4xdx6EIyEhJ +5D58ZgXjSGRln2yBExWvy3eAxgcPSzM+Kujk3r6P0dHT8SG2adH8Ukoo/Rh/IVi1W8a aYRmjyc22iER2ZyNLAK/FBbFNKVzRVmZFnCUBgiWmjJLlts18hhI/HEU3tt2piajAMxV XhAuqJYAN/6H+Fr6MioHJtDdsWBzUG2WeVAseSP+ijOG6VrFODQ8QdvdEJeRM3H4Q5oz QXIepPhJt6R7k51VnfHK9okMwMFhxlxsjPMLRFoBEVxyLC8XsrKnLTai2ubs3Wt6Ht7J 8A7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=VNWJlnS8D3R1qtNkWjI2gcOk+xzWeoMR0nb5d8arbug=; b=jBtV1NGvjfCGcw9v78exEsr26DEBpTACHE2XPmloK2y+FcLpg+hCYwaluVSpFrfBo8 pydIs/pcsMIgGr++pTeUAcrWYkRGP8PDVFpNsNY7SqGoz82mkS9RAqwHJpRtd7F1lJtn OVVC1b7xp8HekYQJho7LfUbyAwsqK6lJ0qREnXteohYqCPAmmrK04CI6weCKhwAmz2t2 6TTbf1DxomiqrvdeAmKHIeFy4JEXMWuBf7s4fo2cTbvSkCXAFCzP0U+DMmoTQn3DCC1C cUvpIs+e3TCHHYs9nN+jg+PF28Iv9c0hy5Bcoq5SG4++M/9zJ6BTJU8WxoBYMVrhieus 2ucA== X-Gm-Message-State: AD7BkJJvaafakMJ78vpyvnHV9nAt2fX0AQ5Yd1UEDTxW45OYL0i1u/k9PoORSpN/EpICwWsZWQ4w19tZ5BahsA== X-Received: by 10.176.2.17 with SMTP id 17mr5764153uas.104.1460157892912; Fri, 08 Apr 2016 16:24:52 -0700 (PDT) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.159.40.7 with HTTP; Fri, 8 Apr 2016 16:24:13 -0700 (PDT) In-Reply-To: References: Date: Sat, 9 Apr 2016 08:24:13 +0900 X-Google-Sender-Auth: ws_2V4HmTYCnawnSSn1DdPjJUBc Message-ID: To: Andrey Andreev Cc: "internals@lists.php.net" Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC][Discussion] Add session_gc() From: yohgaki@ohgaki.net (Yasuo Ohgaki) Hi Andrey, On Fri, Apr 8, 2016 at 6:54 PM, Andrey Andreev wrote: > 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. I thought you claim that use of gc_maxlifetime is wrong. 3. If session_gc() bypasses the gc_probability, gc_divisor INI settings*, then why does it still rely on gc_maxlifetime? Anyway, you're suggesting session_gc() should have $ttl = ini_get('session.gc_maxlifetime') as the TTL parameter. This sounds reasonable and I'll add optional 1st parameter. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net